QA.TechInterviews.com - your tech questions answered
Using Oracle, How Do I Insert A Text Field With An Embedded ';' Value.?
I have a table with several text fields. I am trying to insert text in one of those fields that includes new lines and a semicolon ';'. SQLPLUS interprets the the semicolon as the end of the command, and reports an error:

SQL> insert into mytable values ('
field;
', 'field2');

ORA-01756: quoted string not properly terminated.

Escaping with field'';'' eliminates the error, but leaves the value as "field';'", which is not what I want. Escaping with '\' does not help. How do I escape a semicolon at the end of a line of multiline text input?
see http://www.oracle.com/technology/support/tech/sql_plus/htdocs/faq101.html#A5130

Another problem seems to be the apostrophes.
Use two apostrophes inside the string to insert.
see http://www.oracle.com/technology/support/tech/sql_plus/htdocs/faq101.html#A5130

Another problem seems to be the apostrophes.
Use two apostrophes inside the string to insert.

Back to QA. TechInterviews.com. Powered by Yahoo! Answers and TechInterviews.com community.