DECLARE
TYPE cursor_ref_type IS REF CURSOR;
l_pscur cursor_ref_type;
l_sql VARCHAR2(2000);
p_data_level_id NUMBER DEFAULT 17703;
l_ext1 NUMBER;
BEGIN
IF (p_data_level_id = 17701)
THEN
l_sql := 'SELECT 1 FROM dual';
ELSIF (p_data_level_id = 17703)
THEN
l_sql := 'SELECT 2 FROM dual';
END IF;
OPEN l_pscur FOR l_sql;
FETCH l_pscur
INTO l_ext1;
CLOSE l_pscur;
IF (l_ext1 IS NOT NULL)
THEN
dbms_output.put_line(l_ext1);
END IF;
END;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25684327/viewspace-692767/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25684327/viewspace-692767/