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 -> data moving / FETCH / LONG / etc..

data moving / FETCH / LONG / etc..

From: John W. Kinkead <kinkead_at_ghg.net>
Date: Tue, 22 Sep 1998 08:20:38 -0500
Message-ID: <3607A426.9BCA477@ghg.net>


I am trying to move data from one table to another table which is the same with the addition of a unique-id field. The problem is that one of the fields in the original table is long, and I'm getting errors when attempting to solve the problem various ways.

Some background info:

    SCO OPENDESKTOP 5
    ORACLE 7
    PRO*C Initially, I tried to use the

    EXEC SQL INSERT INTO table2 ("unique-id", field1, field2, etc...)

        SELECT field1, field2, etc.
        FROM table2;

but it complains about the long field, so then I tried to

    SELECT field1, field2, etc...
    FROM table2
    ...
    EXEC SQL FETCH CURSOR1 INTO :field1, :field2, etc....

and now it complains that I'm fetching a null value, so I try

    SELECT nvl(field1, -1), nvl(field2, -1), ...     FROM table2

but apparrently you can't use the NVL function with the long field.

Any suggestions? Perhaps there is an easier way to move the data to a new table with one additional field. Any help is appreciated and let me know if you need more info. Thanks.

John Received on Tue Sep 22 1998 - 08:20:38 CDT

Original text of this message

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