Subject Re: [ib-support] Dynamic SQL Error
Author Arno Brinkman
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.

This isn't related to your problem, so far as i can see !

> 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.

It sounds to me that the NULL and comma ( NULL, ) is the problem!

Regards,
Arno