Re: Stored procedure, dinamic query and handle
Thanks Rick, but it’s not my error. I redefine my question, what is the best solution if my first query doesn’t have results; it will perform my second query which is less restrictive.
Please to forget the code it’s only an example. Querys works fine but the handle doesn’t work.
I’m trying with cursors, simple querys and execute.
It's an example simpler, which doesn’t work too.
BEGIN
DECLARE noResult INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET noResult = 1;
SELECT * from table1 where id = ''; /*No results*/
if noResult = 1 then /*execute first query but don't catch the exception*/
SELECT * from table1 where id = '1';
END IF;
END;
Subject
Views
Written By
Posted
2144
May 28, 2012 02:48AM
1025
May 28, 2012 10:35PM
Re: Stored procedure, dinamic query and handle
1088
May 30, 2012 05:18AM
1106
May 31, 2012 08:28AM
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.