MySQL Forums
Forum List  »  Stored Procedures

Re: what's wrong with that ?
Posted by: Roland Bouman
Date: November 25, 2005 01:22PM

The exists works fine. Convince yourself:

delimiter //

create table t(id int)
//
create procedure pexists()
begin
if exists (Select * from t) then
select true;
else
select false;
end if;
end;
//
call pexists()
//
+-------+
| FALSE |
+-------+
| 0 |
+-------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

insert into t values (1)
//

call pexists()
//

+------+
| TRUE |
+------+
| 1 |
+------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
2264
November 23, 2005 06:22AM
1473
November 25, 2005 04:46AM
1578
November 25, 2005 07:07AM
1581
November 25, 2005 12:46PM
Re: what's wrong with that ?
1595
November 25, 2005 01:22PM
1468
November 25, 2005 05:04PM
1550
November 25, 2005 05:42PM
1574
November 26, 2005 10:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.