OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
RE: Exists Query

From: Schroeder, Alexander (alexander.schroedersap.com)
Date: Tue May 11 2004 - 00:30:57 CDT


Hello,

you either want to do:

        INSERT INTO Z VALUES (1) IGNORE DUPLICATES

(continues without error, count of affected rows is 0, no row is inserted)

or

        INSERT INTO Z VALUES (1) UPDATE DUPLICATES

(issue an UPDATE statement if the record is found)

instead of the implicit REJECT DUPLICATES clause.

Regards

Alexander Schröder
SAP DB, SAP Labs Berlin

> -----Original Message-----
> From: maxdb [mailto:maxdbceroriesgo.co.cr]
> Sent: Monday, May 10, 2004 9:52 PM
> To: maxdb
> Subject: Exists Query
>
>
> How can I implement an IF statement with a Exist predicate
> ej.
> if exists(select 1 from dba.mytable where mycolumnpk=1) then begin
> insert into z values (1);
> end;
>
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
> http://lists.mysql.com/maxdb?unsub=alexander.schroedersap.com
>

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb