Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Export - Urgent question

Status
Not open for further replies.

pierreo

Programmer
Dec 3, 2002
7
0
0
US
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
 
spool <filename>
select * from t;
spool off

(or maybe I don't understand your question? :) )

Alex
 
spool <filename>
select 'insert into t values
('||''''||t1||''''||','||''''||t2||''''||
','||''''||t3||''''||');' from t;
spool off

This will create the <filename> file in which
you will find the script for the creation of
all the records of t.

I hope this helps

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top