Re: Rollback with dbload, How?
Posted in 1996
-S.POTHIREDDY (siva@hogpe.ho.att.com) wrote:
: I have a shell script for data loading process. I would like
: the online engine to rollback if there is an error in loading
: process. I tried several ways for this:
: method 1:
: inputSize=$(wc -l $file | awk '{print $1}'}
: dbload -d database -c spec.com -l err -e 10 -n $inputSize.
: since I wanted dbload to commit at the size of input. This is not
: working well.
My shell scripting is not the best, but this looks pretty good to me (with the
correction of a ")" at the end of the first line instead of "}"). You don't
say what isn't "working well".
: method 2:
: create temp table;
: load data into temp table with dbload command, if fails
: exit with error.
: write an esqlc program to insert rows from temp table into
: dest_table. Do this within transaction.
Assuming you created your temp table to look just like your real table, you
could just:
INSERT INTO real_tab SELECT * FROM temp_tab;
instead of writing an ESQL program.
June
---- June Tong Informix Software ----
---- Senior Consultant (415) 926-6140 ----
---- International Support junet@informix.com ----
---- Location-du-jour: Menlo Park ----