Page 1 of 1

ORA-01704: string literal too long

Posted: Tue 11 Jan 2005 15:00
by mtawk
hi,
Is there a way to send a big string value to an INSERT or UPDATE expression without having this error : ORA-01704: string literal too long.

The problem is that i'm sending an XML text to the field which could more the 10,000 characters

thx

Posted: Wed 12 Jan 2005 07:19
by Alex
We suggest you to use CLOB or LONG Oracle types to store strings that longer than 4000 characters.

If you need more info about using CLOB's , pls see "Working with BLOB and CLOB data types". LONG Oracle datatype represents by ftMemo datatype in ODAC, and have the same behaviour as in BDE.

Posted: Wed 12 Jan 2005 09:08
by mtawk
My code is a follows :
VQuery.SQL.Text := 'UPDATE ' + VTableName + ' SET XML = ' + VXML + ' WHERE ID ='+VID ;

The field XML is of type CLOB in oracle server and i'm getting the oracle error : ORA-01704: string literal too long.

Could the problem be coming from the way i'm writing my query ?

Posted: Wed 12 Jan 2005 15:14
by Alex
It seems that Oracle interprets your VXML value like string and limits its length by 4k, to avoid this you need to use params in your query.