Re: Is there a DBIMPORT like util to append to an existing DB?
Posted in 1994
->From: manmetha@gauss.rutgers.edu (Rajesh Malhotra)
->Subject: Is there a DBIMPORT like util to append to an existing DB?
->Date: 18 Mar 94 13:46:58 GMT
->Reply-To: manmetha@gauss.rutgers.edu (Rajesh Malhotra)
->Organization: Rutgers Univ., New Brunswick, N.J.
->
->Fellow Indormix'ers,
->
-> I have a relatively small database, which I want to grow quickly to
->do some benchmarking. Is there a DBEXPORT/DBIMPORT like utility that I
->could use to export this DB to tape, and then import it multiple times
->to increase its size? When I import it, I want the records to be appended
->to the existing tables, not overwrite them. I cannot use DBIMPORT, since
->it recreates the database.
->
-> I am running the Online 5.0 engine, and have approx. 30 tables in
->the DB.
->
-> Any and all responses on this matter appreciated.
->
->Thanx,
->
->Raj.
->--
->==============================================================================
-> __ __ .
-> / __/ / Raj Malhotra.
->/ ( /_ / voice :
-> __/ email : manmetha@gauss.rutgers.edu
->
->==============================================================================
IF you have a relatively small number of tables, and IF none of your tables
have unique keys, then the technique described below will work for you. If
you have a LOT of tables then this technique would be quite a lot of work.
If your unique keys are numeric, then I can think of some only *slightly*
complicated changes to the script given below to generate new unique keys.
I am not sure how to address the unique key problem for alpha keys, other
than writing a special unload/reload program of some sort. I am not aware
of any "data multiplier" utilities. This doesn't mean they're not available.
Technique:
For each table, write a script like this:
UNLOAD TO tablename.info
SELECT * FROM tablename; { mods needed here for numeric unique keys }
LOAD FROM tablename.info
INSERT INTO tablename;
You need to write a script like this for each table; or more likely, write
one lo-o-o-ong script with a section like this for each table.
Each time you run the script(s), the table(s) will double in size.
Regards,
Alan ___________________________
______________________| R. Alan Popiel |__________________________
\\ Internet: | Martin Marietta, SLS | /
\\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. /
)Voice: | Denver, CO 80201-0179 USA | (
/ 303-977-9998 |___________________________| (But you knew that!) \\
/________________________) (____________________________\\