I think it is worth noting, that the FOR UPDATE statement as interpreted by
Oracle in fact does *not* comply with the SQL standard. The SQL standard
does not include any way to explicitly request locks, but instead mandates
the use of isolation levels (and associated implicit locking) which are set
on a per-transaction or per-connection level. As defined by the SQL
standard, the FOR UPDATE predicate is the default for any SELECT statement
(i.e., it is implied even if you dont write it), and it does not cause any
special locking behavior.

This may be important if you will be porting to other DBMS. IBM's DB2, for
example, implements the described part of the SQL standard quite faithfully.

regards,
Christian

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 3:04 PM
Subject: FOR UPDATE


> I am having trouble using locks within a SELECT query. I'd like to use the
> SQL standard "FOR UPDATE", since I am actually porting a system from
Oracle
> to SapDB.
> When I make even a simple query like:
>
> SELECT * FROM Table FOR UPDATE
>
> I get the following error message:
>
> Missing keyword:OF
>
> [OF is the optional keyword for specifying the columns to lock. Since I
> want to lock all the columns, I shouldn't use OF.]
>
> The question is: can use "FOR UPDATE" in a SELECT query by itself? If not,
> what would it be the most similar solution?
>
> - Thanks
>
> __________________________________
> Gabriele Carcassi
> SerializeDB DevTeam
> DyLogic S.r.l., via G.B. Brocchi 7/a, 20131 Milano
> ph. +39 02 26688231, fax +39 02 26688232
> [EMAIL PROTECTED]
> http://serializedb.dylogic.com
>
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to