Re: Routine to create SQL Insert statements from table data
Posted in 1999
In article <373064bd.65697197@news.maricopa.gov>, fprose@rocketmail.com
says...
> Does someone have a routine which will take the contents of a table
> and create SQL Insert statements? I've searched the IIUG library but
> can't find what I'm looking for. We have a need to repopulate certain
> tables in a training database several times a day and want the
> instructors to control this.
>
>
try this:
to create a script that will load the following table:
test
field1 integer,
field2 integer,
field3 char(5)
unload to reloadit.sqlselect
"insert into tablename values (",
field1,
",",
field2,
", \\"",
field3,
"\\");"
then just remove the pipes and you've got a sql to load the data.
Note: if there's a way to do an unload without delimiters, I'd be
interested in learning it.
--
---------------------------------------------------------------
Aaron A. Brooks
Senior Manager, Information Logistics
PC Service Source
Work: abrooks@pcservice.com Home: abrooks@airmail.net