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

Home -> Community -> Usenet -> c.d.o.misc -> using the long datatype in Oracle 7.2

using the long datatype in Oracle 7.2

From: Nancy Capitanio <nlcapit_at_mailbox.ucdavis.edu>
Date: Wed, 02 Dec 1998 15:15:03 -0800
Message-ID: <3665C9F7.B2E66223@mailbox.ucdavis.edu>


Hello,

I am trying to insert more than 2000 characters into a column defined as long.

Create table test (

        field1 long
)

When I do, I get the following message:

01704, 00000, "string literal too long"
// *Cause: The string literal is longer than 2000 characters.
// *Action: Use a string literal of at most 2000 characters.
// Longer values may only be entered using bind variables.

The only reference I could find to "bind variables" was regarding PL/SQL variables, so I tried creating a procedure that concatenates two 2000 character variables and then inserts them:

declare

	var11 varchar2(2000);
	var12 varchar2(2000);
begin
	var11 := '<a string of 1,999 ones>';
	var12 := '<a string of 1,999 ones>';
	insert into test (field1) values (var11||var12);
	commit;

end;

This causes the error:

01489, 00000, "result of string concatenation is too long"
// *Cause: String concatenation result is more than the maximum size.
// *Action: Make sure that the result is less than the maximum size.

Can someone please tell me how one inserts > 2000 characters in a long column?

Thanks very much,

Nancy Capitanio
Programmer Analsyt
UC Davis Received on Wed Dec 02 1998 - 17:15:03 CST

Original text of this message

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