Re: INSERT INTO a LONG datatype

From: <vermaat_at_gemini.tfdl.agro.nl>
Date: 1996/04/03
Message-ID: <1996Apr3.061251.420_at_ns2>#1/1


In article <1996Apr2.152829.14785_at_nosc.mil>, mvergara_at_sctcorp.com (Michael P. Vergara) writes:
>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.

It should, but it's the long way round. In SQL*Plus you can give the command SET LONG [value], so you can insert string with a maximum length of this value.



| Peter J.R. Vermaat | Dutch Department of Agriculture | Wageningen |

| p.j.r.vermaat_at_tfdl.agro.nl | http://gemini.tfdl.agro.nl:1024/~vermaat/ |
|                           Flagellant in Dreamland                            |
********************************************************************************
Received on Wed Apr 03 1996 - 00:00:00 CEST

Original text of this message