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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Inserting into a long column

RE: Inserting into a long column

From: Afanassiev, Alex <Alex.Afanassiev_at_team.telstra.com>
Date: Thu, 14 Sep 2000 12:10:19 +1100
Message-Id: <10618.116921@fatcity.com>


Hi Steven

I think you cannot do it in sql ( use a string liter that is longer than 2000 characters).
The work around is to use the bind variables.

For example VARCHAR2 variable in PL/SQL

drop table tlong;
create table tlong (a long);
declare
  vlong VARCHAR2(32000);
begin
vlong := '

1234567890......................more that 2000 chars';
insert into tlong values (vlong);
end;
/
set long 10000000
select * from tlong;

With regards
Alex Afanassiev
Oracle DBA, TOC OPS/Internet.Operations

Tel:	(03) 8 661 20 61
Fax:	(03) 9 650 36 74



> -----Original Message-----
> From: Steven Monaghan [SMTP:MonaghaS_at_mscdirect.com]
> Sent: Thursday, September 14, 2000 2:35 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Inserting into a long column
>
> We are getting the following error when inserting into a table:
>
> ORA-1704: string literal too long
>
> The field we are inserting into is a long, so the field can definitely
> handle the data. But, the insert statement does not seem to allow entry
> of
> a quoted string greater than 2000 characters in the quoted string.
>
> How do I get around this? Is there any way to do this in plain SQL, or do
> we need to use PL/SQL?
>
> Steve
> -------------------------------------
> Steven Monaghan
> Oracle DBA
> MSC Industrial Direct Co., Inc.
> Melville, NY
> MonaghaS_at_mscdirect.com
> -------------------------------------
> --
> Author: Steven Monaghan
> INET: MonaghaS_at_mscdirect.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Wed Sep 13 2000 - 20:10:19 CDT

Original text of this message

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