ISQL Begin Work & Commit Work

ISQL Begin Work & Commit Work

Post by Igodd.. » Sun, 31 Dec 1899 09:00:00



. .dra.com!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com?
. !dispatch.news.demon.net!demon!netcom.net.uk!not-for-mail

.Newsgroups: comp.databases.informix
Subject: Re: ISQL Begin Work & Commit Work
.Date: Tue, 11 Mar 1997 21:24:49 -0800
.Organization: Iota Data Systems Ltd



.NNTP-Posting-Host: dialup-17-24.netcomuk.co.uk
.Mime-Version: 1.0
.Content-Type: text/plain; charset=us-ascii
.Content-Transfer-Encoding: 7bit
.X-Mailer: Mozilla 3.0Gold (Win16; I)
.Lines: 58
.Xref: uustar.starnet.net comp.databases.informix:43461

Hi, Richard.

Let's assume you're doing a LOAD.

I would execute something like:

BEGIN WORK;
LOCK TABLE this_tab IN EXCLUSIVE MODE; {Optional but I prefer this}
LOAD FROM "this_data.unl" INSERT INTO this_tab;

I would not include a COMMIT or ROLLBACK at this stage.  If the LOAD
runs without crashing and claims to have loaded the number of rows I
expected I would then run COMMIT WORK as a singleton statement or, if
the LOAD failed, run a ROLLBACK WORK.

In practice I might well have split the load file so that actual script
would be:

{COMMIT WORK;}
BEGIN WORK;
LOCK TABLE this_tab IN EXCLUSIVE MODE; {Optional but I prefer this}
LOAD FROM "xaa" INSERT INTO this_tab;

If all went well I'd uncomment the COMMIT and change xaa to xab.

Likewise if I had a long list of operations I'd start with:

BEGIN WORK;
<command for 1st operation>
{
COMMIT WORK;
BEGIN WORK;
<command for 2nd operation>
...
etc
...

Quote:}

and then work my way down commenting out completed operations and
uncommenting the next operation, always starting with the COMMIT for the
previous job.

Regards

Ian


> 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 ?

> Richard Jevon
> Nottinghamshire County Council


 
 
 

1. ISQL Begin Work & Commit Work

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 ?

Richard Jevon
Nottinghamshire County Council

2. Applet <-> remote database...

3. begin works and commit works in

4. Help...Network record locking problems

5. begin works and commit works in storeprocs

6. crazy query problems

7. large-site wisdom sought

8. BEGIN/COMMIT work in Stored Procedure

9. BEGIN TRANSACTION is working for MSACCESS but not working for SQL Server

10. BEGIN WORK/COMIT WORK in stored procedure

11. begin/end begin tran/commit in while

12. How to do a begin work, commit work in esql ?