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:[EMAIL PROTECTED]
> 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/[EMAIL PROTECTED]
>
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]