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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Insert a long value ORA-01704: string literal too long

Re: Insert a long value ORA-01704: string literal too long

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 2000/02/29
Message-ID: <m39obsotcsjnplmld3h6ve6okgu8j7aqt1@4ax.com>#1/1

A copy of this was sent to spacedog0_at_my-deja.com (if that email address didn't require changing) On Tue, 29 Feb 2000 16:42:38 GMT, you wrote:

>I've had the same problem with any inserts over
>2000 chars. ora-01704 errors all over the
>place. the strange thing is this: it happens in
>a web-based db query program, but also in SQL
>worksheet. hmm...i never had problems like this
>with microsoft sql server...
>chris

You need to use bind variables for character string constants over 2000 character in v7.x and over 4000 characters in 8.x (

See http://osi.oracle.com/~tkyte/Misc/LargeStrings.html for the SQL you can use if you must use a character string constant (as opposed to a much more efficient bind variable) of upto 32k in size.

You won't have to double up the quotes with bind variables either -- they are really the way to go (and don't have 2000/4000 byte limits either)

>
>In article <87cadv$gvd$1_at_nnrp1.deja.com>,
> kirche_at_my-deja.com wrote:
>> hi everyone,
>> i've defined a table with a LONG column to
 store text containing
>> more than 4000 car.
>> The problem is that when i do an insert like :
>>
>> insert into my_table (long_value) values
 ('patati.... patata')
>>
>> i have the oracle error : ORA-01704: string
 literal too long...
>>
>> if 'patati....patata' has less than 4000 car. :
 it's ok.
>>
>> What's the problem ? is it that i use quotes ?
>> it seems that 'patati....patata' is considered
 like a VARCHAR2 data.
>>
>> thank u for help
>>
>> Cyril
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Tue Feb 29 2000 - 00:00:00 CST

Original text of this message

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