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

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with LONG datatypes

Re: Problem with LONG datatypes

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 16 Mar 2006 06:39:58 +0100
Message-ID: <i9uh12lvg7rdl8ck9og1gqvgj49otmpdoa@4ax.com>


Comments embedded

On 15 Mar 2006 16:41:14 -0800, "BD" <bobby_dread_at_hotmail.com> wrote:

>Hi...
>
>I have a task that requires me to rename a column. Problem is, I'm on
>8i, which does not support column-level renaming.
>
>So the next recourse would be to create another column in the table, or
>another table entirely, with the column named correctly, and insert the
>rows/values as required.
>
>Problem is, this column is of LONG RAW datatype. These have been a PITA
>for as long as I've known of their existence.
>
>I have researched my options, and one suggestion is to use the COPY
>command from within SQLPlus. I have tested this, and it works, but only
>across databases.

I don't think this is true. At least I managed to use COPY specifying the tns alias of the database I was connected to for the 'remote' database. Look into 'local loopback' and you will see this is actually documented.
>
>The problem I have with COPY is that it (as far as I can see) will only
>create the new copied column with the same name as the original.
>

I don't think this is true either. You need a SQL statement in the COPY context anyway, so you can remap columns. Just make sure you have a fully qualified statement (as you would use INSERT into <table> (column_a, column_b,...) values (column_x, column_y, .....)

>So what if I want to create this new LONG RAW column with a different
>name?
>
>I have _seen_ it done with a cursor, but am not so confident in my
>PL/SQL as to say I could do it easily.
>
>If COPY had a way I could assign a new name to the new column, I would
>be as good as done.
>
>Anyone out there have any other strategies for dealing with LONG RAWs?
>
>Thanks,
>
>BD

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Mar 15 2006 - 23:39:58 CST

Original text of this message

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