dbTalk Databases Forums  

Data Export - Urgent Training

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Data Export - Urgent Training in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pierre
 
Posts: n/a

Default Data Export - Urgent Training - 07-17-2003 , 01:59 AM






I have the following table:

create table t (
t1 varchar2(35),
t2 varchar2(35),
t3 varchar2(35));

And I insert into this table the following values:

insert into t values ('X1','X2','X3');

I need to export it as a flat file in which each record should be in
the insert data format, e.g. insert into t values ('X1','X2','X3');

I found an option in TOAD which can provide me this format.
Ufortunately I need it to run independently from TOAD.

Regards,
Pierre

Reply With Quote
  #2  
Old   
Guido Konsolke
 
Posts: n/a

Default Re: Data Export - Urgent Training - 07-17-2003 , 02:44 AM






"Pierre" <pierre.olaru (AT) citicorp (DOT) com> schrieb im Newsbeitrag
news:5e0672c6.0307162259.44136d18 (AT) posting (DOT) google.com...
Quote:
I have the following table:

create table t (
t1 varchar2(35),
t2 varchar2(35),
t3 varchar2(35));

And I insert into this table the following values:

insert into t values ('X1','X2','X3');

I need to export it as a flat file in which each record should be in
the insert data format, e.g. insert into t values ('X1','X2','X3');

I found an option in TOAD which can provide me this format.
Ufortunately I need it to run independently from TOAD.

Regards,
Pierre
Hi Pierre,

do you mean something like:
select
'insert into t values ('''||sysdate||''','''
from dual;

Just modify the example to fit your needs.

hth,
Guido




Reply With Quote
  #3  
Old   
Billy Verreynne
 
Posts: n/a

Default Re: Data Export - Urgent Training - 07-17-2003 , 06:52 AM



pierre.olaru (AT) citicorp (DOT) com (Pierre) wrote

Quote:
create table t (
t1 varchar2(35),
t2 varchar2(35),
t3 varchar2(35));
snipped
I need to export it as a flat file in which each record should be in
the insert data format, e.g. insert into t values ('X1','X2','X3');
Standard SQL outputting data in CSV format:
SELECT
t1||','||t2||','||t3
FROM t

Spool to file (e.g. using something like SQL*Plus).

You also may want to enclose character columns with double quotes.

Alternatively, you may want to consider using Oracle's Export and Import utilities.

--
Billy


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.