Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01704: string literal too long
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
![]() |
![]() |