【发布时间】:2018-03-24 08:21:22
【问题描述】:
我有这样的事情:
declare
begin
dbms_output.put_line('some text'|| :bind_variable||'again some text');
end;
我想动态运行开始块,但不能通过立即执行来实现。
以下代码提示输入 bind_variable:
declare
begin
execute immediate '
dbms_output.put_line(''some text''|| ':bind_variable'||''again some text'');
'
;
end;
但抛出以下错误:
Error starting at line : 3 in command -
declare
begin
execute immediate '
dbms_output.put_line(''some text''|| ':bind_variable'||''again some text'');
'
;
end;
Error report -
ORA-06550: line 5, column 39:
PLS-00103: Encountered the symbol "" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like like2 like4 likec between into using || multiset bulk
member submultiset
The symbol "* was inserted before "" to continue.
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
我不知道如何将开始块放在 execute immediate 中。
请帮忙
【问题讨论】: