If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Select and Update one row at a time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-10, 20:43
Torch Torch is offline
Registered User
 
Join Date: Sep 2010
Posts: 1
Select and Update one row at a time

Can someone please help me with this.

I have a table with the following columns (example in XML format)

Code:
<PersonID>0031620</PersonID> 
<POSNUM>000126021</POSNUM> 
<Event>2</Event> 
<TTYPE>1</TTYPE> 
<DateCommenced>020100201</DateCommenced> 
<DateCompleted>099999999</DateCompleted> 
<ManagementUnitCode>21325</ManagementUnitCode> 
<PositionLevelCode>CL1/2</PositionLevelCode> 
<RECSTS>N</RECSTS> 
<TSTAMP>2010-06-17-11.28.13.182000</TSTAMP>
I'm trying to select and update a single row in a table at a time. I think the select will be something like this:

Code:
select * from cpdta10ua.OCC where RECSTS = 'N' order by TSTAMP fetch first 1 rows only
Not quite sure how to do the update though?
Reply With Quote
  #2 (permalink)  
Old 09-02-10, 08:06
Jack Vamvas Jack Vamvas is offline
Registered User
 
Join Date: Jan 2009
Posts: 57
Normally you would do an UPDATE statement as :
UPDATE cpdta10ua.OCC SET [ColumnName]=[Value]
WHERE RECSTS = 'N'

Do you also mean to return a recordset to the client?
__________________
-------------
DBA DB2
SQL SERVER DBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On