Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dumping a table in sql insert format?

Re: dumping a table in sql insert format?

From: Jeff Kish <jeff.kish_at_mro.com>
Date: Thu, 17 May 2007 17:01:52 -0400
Message-ID: <sjgp431l2emcpqt7dbskarbcuhap714c3l@4ax.com>


On Thu, 17 May 2007 20:50:16 GMT, Mark Harrison <mh_at_pixar.com> wrote:

>DA Morgan <damorgan_at_psoug.org> wrote:
>> Mark Harrison wrote:
>> > What's the best way to dump some tables into a file
>> > such that the data is in a series of insert statements?
>> >
>> > I would like to set up some regression tests for my
>> > database, and this is the seed data that is needed
>> > after the schema has been created.
>> >
>> > TIA!
>> > Mark
>> >
>>
>> SELECT 'INSERT INTO t VALUES (' || srvr_id || ')' FROM servers;
>>
>> Wouldn't external tables be easier?
>
>Well, here's my goal, any suggestions appreciated...
>
>I want to be able to easily set up and tear down a development or test
>environment. Ideally such things as sequences will all be initialized
>to known values, so that regression testing is as easy as possible,
>e.g. doing simple string comparisons (dates/times are the main
>trouble here).
>
>So I have a script which creates tables, indexes, etc. This I'm
>getting via a Toad "export/schema" dump, which is working nicely.
>Since it generates a distinct file for each object, it plays nicely
>with our revision control system, and it has a wrapper script that
>sources all the other scripts in the appropriate order.
>
>So all that I'm missing (I think) are some statements at the
>end to initialize some of our "meta" style data, e.g.
>
>insert into types (name,id) values('tla',1);
>insert into types (name,id) values('p4',2);
>insert into types (name,id) values('df',3);
>
>and I'd like to autogenerate these at the same time as I
>generate the schema export script if I can.
>
>Thanks!
>Mark

plsql developer has a nice test data gnerator feature. I guess you need to generate fresh data each time you want to check in a new release/revision, or does it change less often? Jeff Kish Received on Thu May 17 2007 - 16:01:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US