Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01704: string literal too long

Re: ORA-01704: string literal too long

From: Haakon T Soenderland <haakonts_at_online.no>
Date: Wed, 12 Aug 1998 08:36:24 +0200
Message-ID: <35D137E8.A4E2B695@online.no>


Christopher Walls wrote:
>
> We've run into a problem with Oracle 7.3. It appears that the longest
> string one can have in an insert statement (or update) is 2000 characters.
> If I have a column defined as Long (analogous to a MS SQL Server Text
> datatype) which holds up to 2 Gig of character data, how do I put more than
> 2000 characters in it? We've tried concatenating the string but we end up
> with an error message saying "The result of a string concatenation is too
> long".
>
> Example (Field2 is defined as Long):
> INSERT INTO mytable (Field1, Field2) VALUES ('Record1', A String > 2000
> characters)
>
> It seems the error is being thrown by Oracle ("ORA-01704: string literal too
> long"), not the ODBC driver. I plan on testing with the Intersolv ODBC
> drivers but I don't think it's going to work (we're using an Oracle ODBC
> driver written by Microsoft, we never got the ODBC drivers written by Oracle
> to work).

Hi,

There is a limit to how long a _quoted literal_ string can be. Try to put your sting into a bind variable instead.

i.e (pseudo code):

v_field1 = 'Record1';
v_field2 = 'Value > 2k chars...';

INSERT INTO mytable (Field1, Field2) VALUES (:v_field1, :v_field2);

Hope this helps,
Haakon Received on Wed Aug 12 1998 - 01:36:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US