PDA

View Full Version : [MySQL] CONDIZIONE SU PROCEDURE


race2
04-10-2006, 17:55
Mi sapete dire perche non posso mettere una condizione nella query di una stored procedure durante la creazione di un cursore ??


CREATE PROCEDURE `xxxxxxxxx`(IN ID_User_Cli INTEGER(11), IN ID_Cli INTEGER(11))
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT ''
BEGIN

DECLARE cur1 CURSOR FOR
SELECT *
FROM my_table
IF ID_User_Cli=1 THEN
WHERE ID_User=ID_User_Cli
ELSE
WHERE ID_Cliente=ID_Cli
END IF

END;

Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.