Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01704: how to insert long strings ?
There is a limitation in SQL*Plus that you cannot have more than 255
characters inserted into a LONG column. A workaround is to write a PL/SQL
script and use a local variable to store the value first, then insert it
into the LONG column.
Note that the maximum size of a local variable is 32k.
For example, this is a solution in Pro*C:
EXEC SQL begin declare section;
varchar long_val[10000]; /* Bind variable to store the column value */
EXEC SQL end declare section;
strcpy(long_val.arr, "A really really long hardcoded string which used to \
be inside single quotes");
long_val.len = strlen(long_val.arr);
EXEC SQL insert into table (..., long_column, ...) values (..., :long_val, ...);
Note the use of the bind variable, rather than the hardcoded string.
Andreas Jung <ajung_at_saarland.sz-sb.de> wrote in message
news:7mk8ma$sqf$1_at_hades.rz.uni-sb.de...
> Oracle 7.3.3 complains with
> OracleDbError: PARSE caused a ORA-01704: string literal too long
> when I try to insert a long string (2000 chars and more) into a column
> of type LONG. How can I get around this problem ?
>
> Thanks
> Andreas
>
> --
> _\\|//_
> (' O-O ')
> ------------------------------ooO-(_)-Ooo---------------------------------
![]() |
![]() |