oracle 游标查询指定的表名能是一个变量吗?
比如 cursor rs is select res_name, count(req_type) as resSum from ex_log20090828 group by res_name; ex_log20090828 是定义的一个变量
比如 cursor rs is select res_name, count(req_type) as resSum from ex_log20090828 group by res_name; ex_log20090828 是定义的一个变量
type rc is ref cursor;
l_cursor rc;
v_sql varchar2(1000);
v_tab_name varchar2(30);
begin
v_tab_name := 'ex_log20090828';
v_sql := 'select res_name, count(req_type) as resSum from ' || v_tab_name || ' group by res_name';
open l_cursor for v_sql; //sqlend;