Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2007
    Posts
    16

    Post Unanswered: INSERT ... ON EXISTING UPDATE with ASE

    Hi,

    I work with ASE 12.5.0.1 and I need to make insert with possibility of updating if the rows is also recorded without doing a if exists ... insert ... else ... update
    I'd like to use the instruction INSERT ... ON EXISTING UPDATE but when I launch my proc I've got the following message : ' Syntax incorrect near key word 'ON'. '

    If anyone has a solution

    thanks

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Don't know where you got that syntax
    Maybe construct something like this:
    update mytable set column='newvalue' where key='keyvalue'
    if @@rowcount = 0
    insert into mytable values('keyvalue','newvalue')

Posting Permissions

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