从Select语句将varchar2参数传递给plsql过程(Passing varchar2 parameter to plsql procedure from the Select statement)
在Oracle Toad中执行以下语句
exec plsql_procedure(select 'somestring' from dual);转发以下异常:
ORA-06550:第1行,第33列:PLS-00103:遇到以下某种情况时遇到符号“SELECT”:
() - + case mod new not null
过程采用一个VARCHAR2参数。 怎么修好?
Executing the following statement in Oracle Toad
exec plsql_procedure(select 'somestring' from dual);trhows the following exception:
ORA-06550: line 1, column 33: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( ) - + case mod new not null
Procedure takes one VARCHAR2 parameter. How it can be fixed?
最满意答案
除非您使用select from dual只是其他内容的示例,否则请忽略选择。
exec plsql_procedure('somestring');否则,选择一个变量并将其传递给过程。
declare my_var table_name.column_name%Type; begin select column_name into my_var from table_name where ...; plsql_procedure(parameter_name => my_var); end; /Unless your use of the select from dual is just an example of something else, leave out the selection.
exec plsql_procedure('somestring');Otherwise, select into a variable and pass that to the procedure.
declare my_var table_name.column_name%Type; begin select column_name into my_var from table_name where ...; plsql_procedure(parameter_name => my_var); end; /更多推荐
发布评论