| anil k goel 2005-05-15, 9:23 am |
| If all you need to do is "if the record already exists, i can do an update
instead of doing the insert", then you should look into the ON EXISTING
clause of the INSERT statement in ASA. If the row (identified by the PKEY
value specified in the INSERT), already exists, then ON EXISTING allows you
to take any of the following three actions:
1. raise an error (the default behaviour),
2. do nothing
3. update the existing row with the new specified values
I believe the 'instead of' triggers are on the ASA wish list but not
available at the moment.
--
-anil
Research and Development, Query Processing
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
<hbrofman> wrote in message news:4286ba32.9de.1681692777@sybase.com...
> is there a way to do a before insert trigger and not have
> the insert completed (ie based on a condition within the
> trigger) without it being an error condition? i guess what
> i am asking is whether an 'instead of' query can be done in
> asa. i want to set up a particular table insert that if the
> record already exists, i can do an update instead of doing
> the insert. i have found the documentation on this pretty
> weak. it seems that this would work in ms sql and db2 via
> an 'instead of' trigger.
|