我收到了这个错误:
SQL>执行程序hr.p_empleados_limites('Executive');
开始程序hr.p_empleados_limites('Executive');端;
第1行第7列:期待时遇到符号“PROCEDURE” 以下之一:
(如果loop mod null pragma raise,则开始为goto声明退出 使用<<返回选择更新继续关闭当前 delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge忽略符号“PROCEDURE”。
尝试运行此程序时:
CREATE OR REPLACE PROCEDURE P_SALARIO (P_APELLIDO VARCHAR2 )
IS
-- CURSOR EXPLICITO
CURSOR CUR IS
SELECT E.LAST_NAME, D.DEPARTMENT_NAME, ((NVL(E.COMMISSION_PCT,0)*E.SALARY)+E.SALARY) SAL_TOT
FROM HR.EMPLOYEES E, HR.DEPARTMENTS D
WHERE D.DEPARTMENT_ID=E.DEPARTMENT_ID AND
E.LAST_NAME =P_APELLIDO;
V_CUR CUR%ROWTYPE;
BEGIN
OPEN CUR;
LOOP
FETCH CUR INTO V_CUR;
EXIT WHEN CUR%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('APELLIDO: '||V_CUR.LAST_NAME||' DEP_NOM: '||V_CUR.DEPARTMENT_NAME || ' - SALARIO:' || V_CUR.SAL_TOT);
END LOOP;
CLOSE CUR;
END;
----执行程序hr.p_salario('King');
答案 0 :(得分:2)
在调用时删除单词procedure
。它应该就像
execute hr.p_empleados_limites 'Executive';
(OR)
exec hr.p_empleados_limites 'Executive';