Home » SQL & PL/SQL » SQL & PL/SQL » INSERT scripts from table data
INSERT scripts from table data [message #162963] Tue, 14 March 2006 06:24 Go to next message
pjose
Messages: 6
Registered: September 2005
Location: NJ
Junior Member

I'm in Oracle9.2.0.5.

Looking to create insert script from table data. Tables are large in the sense around 80-90 fields and hence, creating the script using select statement would be tedious, I guess. Looking for some general method to do so.

I know that we could do easily in TOAD. Not sure if we could do the same using some DBMS packages.

Thanks.
Re: INSERT scripts from table data [message #163059 is a reply to message #162963] Tue, 14 March 2006 19:32 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
I have an Excel macro that uses the Sheet names for table names, and the first row for column names, and generates INSERT statements from there. I can post it if you're interested.

If the data is already in Oracle and you just want to generate a portable script, AskTom has a script that generates a SQL*Loader control file including the data. I have seen links to it from this forum - do a search.

_____________
Ross Leishman
Re: INSERT scripts from table data [message #163267 is a reply to message #163059] Wed, 15 March 2006 18:36 Go to previous messageGo to next message
pjose
Messages: 6
Registered: September 2005
Location: NJ
Junior Member

Leishman,

Thanks for your reply.

Could you please post the Excel macro here? It'll be definitely helpful for me.

Thanks.
Re: INSERT scripts from table data [message #163270 is a reply to message #163267] Wed, 15 March 2006 19:19 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Here it is
_____________
Ross Leishman
  • Attachment: Inserter.xls
    (Size: 48.00KB, Downloaded 989 times)
Re: INSERT scripts from table data [message #163414 is a reply to message #163270] Thu, 16 March 2006 11:54 Go to previous message
pjose
Messages: 6
Registered: September 2005
Location: NJ
Junior Member

Leishman,


Thank you so much.


It's a cool one!

Thanks.
Previous Topic: ora-0902 invalid datatype
Next Topic: Behaviour statement trigger vs. schedule (job) ?
Goto Forum:
  


Current Time: Fri Apr 26 01:30:25 CDT 2024