编译pll文件,编译报错
PL/SQL ERROR 231 at line 1009, column 45
function \'NAME_IN\' may not be used in SQL
PL/SQL ERROR 0 at line 1006, column 4
SQL Statement ignored
Failed to generate library.
FRM-30312: Failed to compile the library.
原因:pld/pll文件中增加,新增代码
select ALLOCATE_LOT_FLAG into L_ALLOCATE_LOT_FLAG from mtl_parameters where organization_id = TO_NUMBER(NAME_IN(\'parameter.org_id\')) and rownum = 1;
SQL语句中不能直接使用NAME_IN,需要先赋给一个变量之后,再在SQL中引用这个变量。例如可以把上边的代码修改成:
orgid1 := TO_NUMBER(NAME_IN(\'parameter.org_id\')); select ALLOCATE_LOT_FLAG into L_ALLOCATE_LOT_FLAG from mtl_parameters where organization_id = orgid1 and rownum = 1;