Re: SQL question "Transactions"
Posted in 1999
Carlson@WHSmith — — source: Informix-list mailing list archive (1991-1998)
judah wrote:
>
> hi,
>
> What is the proper syntax for transactions;
>
> when I use dbaccess with the following statement I get an error
>
> BEGIN WORK
> LOCK TABLE stock;
> #^
> # 201: A syntax error has occurred.
> #
> UPDATE stock SET unit_price = unit_price * 1.10
> WHERE manu_code ='KAR'
> DELETE FROM stock WHERE description ='baseball_bat'
> INSERT INTO manufact (manu_code, manu_name, lead_time)
> VALUES ('LYM','LYMAN, 14)> COMMIT WORK
>
> what am I doing wrong (it also pukes when I use ;'s
>
> thankx
Try this:
BEGIN WORK;
LOCK TABLE stock;
. . . . snipped . . . .
Note the semicolon after each SQL statement . . . . that should help.
John Carlson
Informix DBA
WHSmith USA