这里 rawlist是一个可以传入的参数。 在代码中打开cursor的时候基于这个参数来决定打开哪个表。
CREATE OR REPLACE PROCEDURE check_parent_and_kid (rawlist VARCHAR2) AS tab_list VARCHAR2(80); TYPE tab_list_cur_typ IS REF CURSOR; tab_list_cur tab_list_cur_typ; BEGIN tab_list := rawlist; OPEN tab_list_cur FOR 'SELECT * FROM '|| tab_list; CLOSE tab_list_cur; END;