Re: string literal too long

From: Justin Cave <jocave_at_yahoo.com>
Date: 18 Sep 2002 08:34:49 -0700
Message-ID: <233b7a65.0209180734.52e84268_at_posting.google.com>


shivasbhat_at_rediffmail.com (shivas) wrote in message news:<346a335.0209180126.49f24ed9_at_posting.google.com>...
> I am getting an error when I try to save 4000 characters in a text item(notepad)
> within my system.Programming language is delphi.
> This happens when I do it against an oracle database.
> The error is.
>
> 'string literal too long'
>
> Does anyone have a solution for this.

First off, varchar2 columns are limited to 4000 bytes. I'm assuming that you're trying to insert into a LONG or LOB column in the Oracle table.

SQL limits a string literal to 4000 bytes as well. Thus, you cannot execute the statement

insert into foo( clobColumn ) values ('4001 byte string');

You have to make use of bind variables. I'm not familiar with the Delphi environment, but you want to execute something along the lines of

:variable = '4001 byte string';
insert into foo( clobColumn ) values (:variable)

which makes use of bind variables.

Justin Cave Received on Wed Sep 18 2002 - 17:34:49 CEST

Original text of this message