【发布时间】:2011-06-07 19:49:58
【问题描述】:
我在 PL SQL 过程中使用以下代码:
execute immediate 'select count(distinct item_type) into counter_variable
from items where ' || field_name || ' is not null'
这里,
counter_variable 在过程的声明部分声明 field_name 是 PL SQL 过程的 IN 参数,传递的值将是“items”表中的列名
我得到的错误是“无效的 SQL 语句”,我无法找出原因。有什么想法吗?
谢谢
【问题讨论】: