Re: Write to a file
Date: 7 Sep 94 13:12:13 +1000
Message-ID: <1994Sep7.131213.1_at_cbr.hhcs.gov.au>
In article <34ieqb$j0_at_tcsi.tcs.com>, madhu_at_tcs.com (Madhu Gopinathan) writes:
> Hi,
> How to write the rows retrieved in a SELECT statement
> to a file(in a PROC program)? (similar to UNLOAD in Informix)
In SQL*Plus you would use the SPOOL command but from Pro*C you would simply have to retrieve each row, format it the way you want it and write it to a file. Use ARRAY processing feature to reduce FETCHes and speed up the task.
> How to reload a table from a file? (similar to LOAD or dbload in INFORMIX)
You can either use the SQL*Loader product OR from Pro*C you simply read the file, retrieve the various column fields and use a SQL statement to insert each row into the database. Again, use ARRAY processing to speed things up.
-- Bruce... pihlab_at_cbr.hhcs.gov.au ******************************************************************* * Bruce Pihlamae -- Database Administration * * Commonwealth Department of Human Services and Health * * Canberra, ACT, Australia (W) 06-289-7056 * *=================================================================* * These are my own thoughts and opinions, few that I have. * ******************************************************************* "The more complex the argument gets, the easier it is to refute." "Killing is wrong!" -- Trent 'The Uncatchable' CastanaverasReceived on Wed Sep 07 1994 - 05:12:13 CEST