Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Posts
    1

    Unanswered: 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?

  2. #2
    Join Date
    Jan 2009
    Location
    United Kingdom
    Posts
    77
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •