Re: ISQL Begin Work & Commit Work
Posted in 1997
In article <5g0vun$1m@cssun.mathcs.emory.edu>,
zprj1@nottscc.gov.uk (Jevon Richard) wrote:
>
>
>Please could anyone tell me how to use the BEGIN WORK, COMMIT WORK and
>ROLLBACK statements in ISQL.
>
>The main question is How do you find out what the status of an UPDATE,
>INSERT so to determine whether to ROLLBACK or COMMIT WORK ??
>
>Am i missing the point ?
>
As far as I can determine, there seems to be an implicit
'WHENEVER ERROR STOP' for all isql statements. That is, if
isql runs into an erroneous statement, it will stop and ask
for instructions, simultaneously indicating the offending
statement and a reasonably good idea of the cause of the
problem.
In other words, under interactive isql, you could, for example
do the following
BEGIN WORK;
INSERT INTO table ....;
INSERT INTO table2 ....;UPDATE table3....;
COMMIT WORK;
Run these statements. If any of the statements fail, ISQL stops at
that point with an error message. If not, it gives you a series of
messages indicating the success of your various statements.
If you are blocked by an error, it would have occurred before the
COMMIT WORK. All you have to do is run a ROLLBACK WORK.
hth
----------------------
Rudy Fernandes (ICP)
GIC, Kuwait
----------------------