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 -> Re: INSERT INTO and LONG columns

Re: INSERT INTO and LONG columns

From: <coneal_at_exis.kill_spammers.net>
Date: 1998/02/11
Message-ID: <34e0ff30.875486@news.exis.net>#1/1

SELECT's are not going to move the LONG's. The easiest and fastest way to move the longs is to use PL/SQL to parse the long. Steve Feuerstein details a method in his Programming w/Packages book. It can be pretty easy if your version supports PL/SQL tables.

On 9 Feb 1998 17:27:12 GMT, "Patrick Bogers" <p.bogers_at_scope-mt.nl> wrote:

>What you could do is create following script
>
>Declare Cursor C_MY_TABLE IS
> SELECT
> FROM My_Table
> WHERE column_b = 1 ;
>
>BEGIN
>
>FOR r_my_table IN c_my_table LOOP
>
> INSERT INTO my_table
> (column_a, column_b, column_c, column_d)
> VALUES
> (r_my_table.Column_a, r_my_table.Column_b, r_my_table.Column_c,
>r_my_table.Column_d);
>
>END LOOP;
>
>END;
>
>
>Rod Gustavson wrote in message <34D87A9B.F7EF639C_at_yale.edu>...
>>Does anyone have a suggestion on how to accomplish the following?
>>
>>I am trying to copy all the rows from a table to itself, but with one
>>value changed. One of the columns is of type LONG, so INSERT INTO
>>returns error ORA-00997, Illegal use of LONG datatype.
>>
>>Example:
>>column_a, column_b, and column_c are numbers, column_d is a LONG.
>>
>>INSERT INTO my_table
>> SELECT column_a,
>> 2,
>> column_c,
>> column_d
>> FROM my_table
>> WHERE column_b = 1
>>
>>If column_d is not a long, the code works.
>>
>>Any suggestions on how I can accomplish this?
>>
>>Thanks.
>>
>>_______________________
>>
>>Rod Gustavson
>>rod.gustavson_at_yale.edu
>
Received on Wed Feb 11 1998 - 00:00:00 CST

Original text of this message

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