【发布时间】:2020-09-04 03:32:17
【问题描述】:
我需要在我的过程中使用一个动态游标来接收来自另一个游标的值。 当我运行这个程序时,我得到 ORA-00936 缺少表达式。 我将这个从光标中选择的内容放入 dbms_output 以查看它是否正确。
这是代码:
BEGIN
OPEN dsa_tables;
LOOP
FETCH dsa_tables INTO
v_owner,
v_table_name,
v_column_name,
v_comments,
v_tech_date;
EXIT WHEN dsa_tables%notfound;
v_table_all := dbms_assert.sql_object_name(v_owner
|| '.'
|| v_table_name);
-- with this cursor is the problem
OPEN count_date FOR ' SELECT '
|| v_column_name
|| ','
|| ' COUNT('
|| v_column_name
|| ') FROM '
||v_table_all
|| ' GROUP BY '
|| v_column_name;
LOOP
FETCH count_date INTO
v_date,
v_count;
EXIT WHEN count_date%notfound;
END LOOP;
CLOSE count_date;
END LOOP;
CLOSE dsa_tables;
END;
/
【问题讨论】:
标签: oracle dynamic cursor ora-00936