PDA

View Full Version : can i Lock a record for update???


ronenhm
01-20-02, 10:47
hi,

i am working with ASE 12.0 with the open client lib
im writting a cross platfrom code to work for win and AIX the same way.

my question is:
can i lock a record while it beeing updated?
what method should i use to do so?
how do i use transaction using the ASE?

example code will be the best for me to understand...

thanks alot

Ronen.

MattR
01-21-02, 20:12
Records are automatically locked when you are changing them (delete, update).

If you want to use a transaction, you can do something like this:

BEGIN TRAN
UPDATE sometable SET somecol = 34
WHERE somecol = 234

-- some other stuff
COMMIT TRAN


But individually, every command is a transaction.