Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Question Unanswered: Update statement for sybase

    I would like to use an update statement in sybase equivalent to what is done in oracle.

    UPDATE ....
    ...
    ...
    RETURNING

    My goal is to return the updated values to the requestor.

    Can anyone help?

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    One option is to use variables


    For eg.,In this case I am doing an incremental update

    DECLARE @newvalue int

    UPDATE tablename
    set @newvalue=columnname + 1,
    columnname=@newvalue

    return @newvalue

  3. #3
    Join Date
    Oct 2003
    Posts
    41
    In the above example

    you can use select instead of return
    This will return more than one value

    FOr ex.
    select @newvalue
    -----------------------------------------------------------------
    One option is to use variables


    For eg.,In this case I am doing an incremental update

    DECLARE @newvalue int

    UPDATE tablename
    set @newvalue=columnname + 1,
    columnname=@newvalue

    return @newvalue
    ====================
    Rajesh

Posting Permissions

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