Using ON EXISTING UPDATE on ASE

This is a discussion on Using ON EXISTING UPDATE on ASE within the sybase forums in Other Databases category; Hi, I'm new on useing ASE 15 and I would like to use the statement similar to MySQL's REPLACE statement. I have surfed the web and found the article MySQL to Sybase ASE Migrtion Guide , it said INSERT....ON EXISTING UPDATE as equivalent to MySQL's REPLACE. However, I got the syntax error when I input something like INSERT INTO table(key, field12) ON EXISTING UPDATE VALUES(1,2). am I using the statement in the wrong way? Is there any alternative way for MySQL's REPLACE? Thanks....

Go Back   Database Forum > Other Databases > sybase

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2008, 01:49 PM
Default Using ON EXISTING UPDATE on ASE

Hi,
I'm new on useing ASE 15 and I would like to use the statement similar
to MySQL's REPLACE statement.
I have surfed the web and found the article "MySQL to Sybase ASE
Migrtion Guide", it said INSERT....ON EXISTING UPDATE as equivalent to
MySQL's REPLACE. However, I got the syntax error when I input something like
INSERT INTO table(key, field12) ON EXISTING UPDATE VALUES(1,2).
am I using the statement in the wrong way? Is there any alternative
way for MySQL's REPLACE?

Thanks.


Reply With Quote
  #2  
Old 08-22-2008, 02:25 PM
Default Re: Using ON EXISTING UPDATE on ASE

On Aug 22, 10:49*am, "Tony Woo" wrote:
> Hi,
> * * * I'm new on useing ASE 15 and I would like to use the statement similar
> to MySQL's REPLACE statement.
> * * * I have surfed the web and found the article "MySQL to Sybase ASE
> Migrtion Guide", it said INSERT....ON EXISTING UPDATE as equivalent to
> MySQL's REPLACE. However, I got the syntax error when I input something like
> INSERT INTO table(key, field12) ON EXISTING UPDATE VALUES(1,2).
> * * * am I using the statement in the wrong way? Is there any alternative
> way for MySQL's REPLACE?
>
> * * *Thanks.


Unfortunately, I believe that document is in error. It may be the
author confused
ASE and Adaptive Server Anywhere (which I think has that command).

The alternative would be to use and update followed by an insert where
not exists.
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 08:27 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.