First, please be aware that MySQL 5.0 is an alpha release. It is very young and there 
may still be some unresolved issues. It is not generally recommended to use alpha 
releases in production situations. Besides, anything that can be done in a stored 
procedure can be implemented in client side code.

That said, the If Exists is used with Create and Drop statements. I don't think that 
you can use it to determine the rows returned by a select statement. 

There may be other techniques but this is what I'd do:

Take your select query any convert it to a count(*) query and use Select Into to store 
the count in a variable. Use this variable in your if statement.

See this chapter in Select Into:
http://www.mysql.com/doc/en/SELECT_INTO_Statement.html

If it isn't possible to turn your query into a count(*) then you might try using 
FOUND_ROWS(). See this chapther for more info:

http://www.mysql.com/doc/en/Miscellaneous_functions.html

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to