During data correction today, I wrote a batch of simple update statements. The results showed a problem in sqlplus execution, prompting me to enter the value of the corresponding parameter?
The original SQL statement is: Update trans_record set Params = 'service = standard_bail & xxx = 112 'Where trans_record_id = '20140901 ';
After investigation, the problem lies in the character &, which is a character passed in by the control parameter;
There are several methods to solve the execution problem:
1. Execute in sqlplusSet define offDisable special characters. You can use show define to view the special characters;
2. Update trans_record set Params = 'service = standard_bail'| '&' |'Xxx = 100' where trans_record_id = '20140901 ';
3. Update trans_record set Params = 'service = standard_bail'| CHR (38) |'Xxx = 100' where trans_record_id = '20140901 ';
4. Update trans_record set Params = 'service = standard_bail/&Xxx = 112 'where trans_record_id = '201312 ';
The first method is recommended for the above four methods, which is simple and completely solves the special character problem (the premise is to see which special characters are closed in the end), because there are not only special characters, but also %;
PS: this type of problem only occurs in sqlplus. This problem does not occur during direct JDBC operations in our daily development;