Hello, everyone,
In Oracle 10g, how does one return the value of a variable that was declared/set within a query?
For example, consider the following:
DECLARE cnt INTEGER(1);
BEGIN
SELECT 1 into cnt FROM SYS.DUAL WHERE EXISTS (a query that gets at least one record)
IF cnt = 0
THEN
... an insert query
ELSE
SET cnt = 1;
END IF;
END;
How do I return the value of cnt?
V/r,