Re: insert/select LONG

From: Scott Tiger <kml_at_cellar.org>
Date: 19 Apr 93 13:00:38 GMT
Message-ID: <RN992B6w164w_at_cellar.org>


rbasi_at_teleng.eng.telxon.com (Richard Basile) writes:

> NEVER SAY DIE!!! There has to be a way!
>
> I have a table with a LONG field. The data for this table is in
> another table. I can't do:
>
> insert into tableA (fld1, fld2, fld3long)
> select fldA, fldB, fldClong
> from tableB;
>
> So, how do I get long data from one table to another? I don't care if
> I have to stand on my tounge, there has to be a way to do this.

You have a few options. (1) use SQR's export facility - it writes the data to an ASCII file, breakining up the LONG column as it does, then putting it back together during the import. (2) Write the same sort of utility yourself, using SQL*Plus, SQL*Loader, or Pro*C. Write the data to a flat file and then read it into the second table. (3) use export/import. exp the table owner, then either imp the table into a different user (via the fromuser and touser flags) or change the table name you're copying from and imp the table out of the xport dump file (since it'll want to create a table with the same name as was exported). One other idea that I've never tried - you can read LONG datatypes into PlSQL character variables - which you can define to be up to 32767 characters. If you're LONGs don't exceed tha, then you may be able to write a PlSQL block that loops through the table, reads the LONG column into the character field, and then inserts it, along with the rest of the record, into the second table.

::::::::::     ::    ::        :::::Alself me to myduce introlow
 Scott/::: ::::::< ::::: . :::::::::kml%cellar_at_tredysvr.tredydev.unisys.com
::Tiger::::::::::    :: ::: ::::::::kml_at_cellar.org  Damn the electric fence!
Received on Mon Apr 19 1993 - 15:00:38 CEST

Original text of this message