ORA-01704: string literal too long

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mtawk

ORA-01704: string literal too long

Post by mtawk » Tue 11 Jan 2005 15:00

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

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Wed 12 Jan 2005 07:19

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.

mtawk

Post by mtawk » Wed 12 Jan 2005 09:08

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 ?

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Wed 12 Jan 2005 15:14

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.

Post Reply