Re: INSERT INTO a LONG datatype

From: Michael P. Vergara <mvergara_at_sctcorp.com>
Date: 1996/04/02
Message-ID: <1996Apr2.152829.14785_at_nosc.mil>#1/1


In article <4j77mq$snr_at_news.cais.com>, mappler_at_cynacom.com (Matthew Appler) says:
>
>I am trying to insert data into a table in a column that is a LONG. I have
>met with marginal success and I believe the problem is that I am formulating
>my SQL statement incorrectly.
>
>For example, if I enter the following statement:
>
>INSERT INTO tablename
>VALUES (254, 'Test', 'This is the long value');
>
>It works just fine (assuming the last column is the long column). However, if
>the last string is > 2000 bytes I get an error that the string literal is too
>long. ie: if I quote more than 2000bytes, it doesn't work.
>
>Therefore, how do I insert more than 2000 bytes???? Any help would be greatly
>appreciated...
>

Presuming that you're using SQL*Plus, you must use PL/SQL. Something like this...
declare

   long_var varchar2(32767);
begin

   long_var := 'This is the long value';    insert into tablename values

      (254, 'Test', long_var);
end;
/
...should work.

HTH
Mike Received on Tue Apr 02 1996 - 00:00:00 CEST

Original text of this message