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: LONG to VARCHAR: How can it be done?

Re: LONG to VARCHAR: How can it be done?

From: terryg8 <trg_at_ibm.net>
Date: 1997/07/18
Message-ID: <33D00CD0.6A2E@ibm.net>#1/1

Thomas Greuter wrote:
>
> Hi2everybody,
>
> I have a view to a table on a SQL-Server using the oracle gateway. The view
> desc looks as follows:
> Name Null? Type
> ------------------------------- -------- ----
> ARTIKEL_ID NOT NULL NUMBER(10)
> BEZEICHNUNGD NOT NULL LONG
>
> BEZEICHNUNGD contains the text I have to put in another table where it is
> defined as VARCHAR2(255).
>
> Since simple INSERT/UPDATE doesn't work with LONG datatypes, I need some
> kind of conversion. There is no such thing in PL/SQL as I know.
> Q: How can this be done? I'm really in trouble, because this is part of a
> data sync process between two databases.
>
> Every hint is very, very welcome
>
> Thomas
> [ENV: ORACLE 7.3, NT4.0, Intel]
>
> [This msg is also posted in newsgroup oracle.sever]
How about using sql to generate more sql? ie

   set linesize 255
   select 'insert into tableB values ('||artikel_id||','''||

          bezeichnungd||'''')
   from tableA;

Dump into a file and use it to do your insert. It's not pretty but it is simple, sometimes simple is best:)

Cheers,
TRG Received on Fri Jul 18 1997 - 00:00:00 CDT

Original text of this message

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