Home » SQL & PL/SQL » SQL & PL/SQL » Database script for Insert statements (oracle10g,, aix53)
Database script for Insert statements [message #423171] Tue, 22 September 2009 07:07 Go to next message
Messages: 46
Registered: May 2008
Location: Hyderabad
Hi All,

Actually i have one table XYZ with 100 rows. I want the insert statements for that rows.

For example :
SQL> select * from XYZ;

col1 col2 col3
------------------ ------------------ -----------------
abcdegsts xsadfsdfddfdf fdsfh gdf
dvjhjddjd dfdsfdfdfsdsdf dskfhgfsd

2 rows selected.

now i require insert statements for these rows like

INSERT INTO XYZ values('abcdegsts','xsadfsdfddfdf','fdsfh gdf');
INSERT INTO XYZ values ('dvjhjddjd','dfdsfdfdfsdsdf','dskfhgfsd');

Like this i require for all the 100 statements. Please help me in this.

Thank you...
Re: Database script for Insert statements [message #423173 is a reply to message #423171] Tue, 22 September 2009 07:11 Go to previous messageGo to next message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Write something like
SELECT 'INSERT INTO XYZ (col_1,col_2) ('''||col_1||''','''||col_2||''');'
Re: Database script for Insert statements [message #423176 is a reply to message #423171] Tue, 22 September 2009 07:31 Go to previous message
Michel Cadot
Messages: 65084
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topic:
Michel Cadot wrote on Mon, 21 September 2009 14:15
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Your answer:
chandu_imax wrote on Tue, 22 September 2009 08:14
Thank you Michel. I will follow the instructions from now onwards.



Previous Topic: Update an unprocessed record exclusively
Next Topic: trigger problem
Goto Forum:

Current Time: Sat Jul 22 00:10:50 CDT 2017

Total time taken to generate the page: 0.12676 seconds