RE: Errors while inserting into long data type



> I am using oracle database and I have column of long data
> type. I insert the
> data into this column thru perl script. If the inserted data
> exceeds 4000
> chars, it is giving me the following error.
>
> DBD::Oracle::st execute failed: ORA-01704: string literal too
> long (DBD
> ERROR: OCIStmtExecute) at MT/TACDbManager.pm line 445.
>
> Whereas we can insert upto 2GB of data in long data type.

You've not posted any code, but if it's saying "string literal too long"
then the first thing to ask is whether you're using placeholders. If you're
embedding values in the SQL statement itself, then stop doing that, and
start using placeholders (aka bind variables).

Like it says in the manual:

ORA-01704: string literal too long
Cause: The string literal is longer than 4000 characters.
Action: Use a string literal of at most 4000 characters. Longer values
may only be entered using bind variables.

--
Andy Hassall <andy@xxxxxxxxxxx> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

.



Relevant Pages

  • Regex question
    ... Can anyone tell me how a regular expression can return: ... match any number or type of characters here ... And then print the string, including the placeholders: ...
    (comp.unix.questions)
  • Re: Tilds
    ... The tilde characters don't do anything in VFP so they're just placeholders. ... the program/report might look for those characters and do something ...
    (microsoft.public.fox.vfp.queries-sql)