roy*_*g86 0 oracle plsql stored-procedures oracle-sqldeveloper
我有一个名为logger(message)的存储过程,其中message的类型为varchar2.
当我执行时
exec logger('hello');
Run Code Online (Sandbox Code Playgroud)
它表示匿名块已完成,此过程的作用只是在另一个表中插入记录.
但是,当我用它作为脚本的一部分说:
Begin
select count(*) into countCol from USER_TAB_COLUMNS where TABLE_NAME = 'EVAPP_INTERFACE_APPENTITY' and COLUMN_NAME = 'ORIGPTI_NUM' and DATA_SCALE is null;
IF (countCol <> 0) then
execute immediate 'alter table EVAPP_INTERFACE_APPENTITY add ORIGPTI_NUM_TMP NUMBER(14,2)' ;
execute immediate 'update EVAPP_INTERFACE_APPENTITY set ORIGPTI_NUM_TMP = ORIGPTI_NUM' ;
execute immediate 'alter table EVAPP_INTERFACE_APPENTITY drop column ORIGPTI_NUM' ;
execute immediate 'alter table EVAPP_INTERFACE_APPENTITY rename column ORIGPTI_NUM_TMP to ORIGPTI_NUM' ;
DBMS_OUTPUT.put_line('This column EVAPP_INTERFACE_APPENTITY.ORIGPTI_NUM has been modified to the required precision');
END IF;
execute logger(' first insert');
Run Code Online (Sandbox Code Playgroud)
我得到这个错误说:
Error report:
ORA-06550: line 27, column 10:
PLS-00103: Encountered the symbol "LOGGER" when expecting one of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "LOGGER" to continue.
Run Code Online (Sandbox Code Playgroud)
我尝试立即执行并只插入logger(),但没有任何作用.
当我尝试在脚本中搜索执行存储过程时,我对谷歌没有太多帮助.我该如何调用此程序?