Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT/UPDATE Alternative 1

Status
Not open for further replies.

djlmml

Technical User
Dec 24, 2002
3
US
I'm trying to accomplish the same sql statement as I have done for Oracle but for DB2.

In Oracle I use the Oracle/PLSQL: SELECT FOR UPDATE Statement - example select_statement
FOR UPDATE [of column_list] [NOWAIT];

Without needing to code for 2 statements each time, is there an equivalent in the DB2 world. The DB2 is UDB on the AS/400.

Thanks in advance
David


 
Why do you think "select ..from table for update of..." doesn't work on DB2 ? It works fine on my DB2 7 database on Solaris.
 
Just realised you are referring to the "nowait" clause. I don't think this option exists.
 
This executes and returns the current nfaxid in sysinfo. It does not update the value in the system and when I attempt to add a set statement to the end the sql fails. This also does not lock the value until and update happens. I was able to execute this statement and then go to another session and update and select the value there - I'm trying to prevent another user/process from updateing this record until it the first is completed.

Select nfaxid from sysinfo for update of nfaxid

I'm I doing this correctly ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top