Subject Dynamic SQL Error
Author Jatin N. Bhoir
Hi,

I have an insert statement where i pass literal values. And one of the field value has a ";" semicolon as a part of data. But as i run the script in Interactive SQL, i get the following error
Dynamic SQL error,
SQL Error Code = -104
Token unknown - line 2, char -1

I read Borlands document http://bdn.borland.com/article/0,1410,25443,00.html for details on this error. Its because of the ";" in my data that it terminates first line of SQL statement.

But my question is how do i have an escape char for this semicolon in my data. So that i dont get this error in a script file. Following is a sample of my SQL statement,

INSERT INTO ptrxlab(MAGXPTR, TOUXPTR, ZIPXPTR, PAYXPTR, COAXPTR, COBXPTR, COCXPTR, CODXPTR, DIEXPTR, DIBXPTR) VALUES ('E4', 'MAZET M', '24', 'FR', '240', NULL, NULL, NULL, '007;', NULL);

INSERT INTO ptrxlab(MAGXPTR, TOUXPTR, ZIPXPTR, PAYXPTR, COAXPTR, COBXPTR, COCXPTR, CODXPTR, DIEXPTR, DIBXPTR) VALUES ('E4', 'MAZET M', '24580', 'FR', '240', NULL, NULL, NULL, '007;', NULL, );

These queries execute fine when i execute them one line at a time. But i have about 124 such lines of exceptional insert statments, which i dont want to execute one at a time. The SQL statement terminates at "007;". How do i go about adding this special character in my table.

Please suggest and help,

Jatin


[Non-text portions of this message have been removed]