1) no direct equivalent. You could either
- code the select as a CURSOR (including the FOR UPDATE clause), open it, fetch, update where current of, and close; or
- use the select WITH RS. This will lock the row against updates by other processes. Of course, I personally like the added protection of including appropriate WHERE predicates in the following UPDATE statement to ensure that the row hasn't been changed - but that's just paranoid me.

2) select 1 from sysibm.sysdummy1

Might I suggest the redbook Converting from AIX to DB2 for OS/390 SG24-5478, available at http://www.redbooks.ibm.com/ . While, perhaps, not your actual target version of DB2, it does highlight many conversion issues.

James Campbell




> --------------- MESSAGE db2eug.v002.n185.3 ---------------
>
> From: Ranjana Deshmukh <[EMAIL PROTECTED]>
> Subject: How to lock a row or table for update ???
> Date: Thu, 18 Oct 2001 17:00:44 +0530
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
>
> Hi,
>
> We are using DB2 UDB 7.2. We are converting from Oracle to the mentioned.
>
> Can anyone please tell what is the equivalent in DB2 UDb for the following
> in Oracle.
>
> 1) select project_id into xproj from fgt_assignments
> where id = xassign_id for update;
>
> 2) select 1 from dual;
>
> Any help is appreciated.
>
> Thanks & Regds
>
> R. Deshmukh
>
>
> --------------- END db2eug.v002.n185 ---------------
>
>
> =====
> You are subscribed to the DB2EUG digest. To receive messages
> separately, send email to [EMAIL PROTECTED]
> containing the line: subsingle <your-email-address>
> To unsubscribe, send: unsubscribe <your-email-address>
>


James A Campbell

=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod



Reply via email to