sql - 警告:在 plsql 中创建的包体存在编译错误...
问题描述
错误:
警告:包体创建时出现编译错误。BEGIN * ERROR at line 1: ORA-04063: package body "P12284.EMP_DESIGNATION" has errors ORA-06508: PL/SQL: could not find program unit being called: "P12284.EMP_DESIGNATION" ORA-06512: at line 2
如何解决这个?请帮助我,我是 PL/SQL 新手
`
set serveroutput on;
CREATE OR REPLACE PACKAGE EMP_DESIGNATION
AS
PROCEDURE EMP_DETAILS(PS_design employee.designation%TYPE, PS_incentive number);
END EMP_DESIGNATION;
/
CREATE OR REPLACE PACKAGE BODY EMP_DESIGNATION
AS
PROCEDURE EMP_DETAILS(design employee.designation%TYPE, incentive number)
IS
BEGIN
update employee set employee.salary = employee.salary + incentive where designation = design ;
DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ' employee(s) are updated');
END;
/
`
解决方案
你有两个问题,
的签名
emp_details
应该在规范和正文中匹配您忘记了
end
包正文中的程序。CREATE OR REPLACE PACKAGE emp_designation AS PROCEDURE emp_details ( ps_design employee.designation%TYPE , ps_incentive NUMBER ); END emp_designation; / CREATE OR REPLACE PACKAGE BODY emp_designation AS PROCEDURE emp_details ( ps_design employee.designation%TYPE , ps_incentive NUMBER ) IS BEGIN UPDATE employee SET employee.salary = employee.salary + ps_incentive WHERE designation = ps_design; dbms_output.put_line(SQL%ROWCOUNT || ' employee(s) are updated'); END emp_details; END; /
推荐阅读
- angular - 如何创建一个订阅,当您取消单击鼠标按钮以进行角度拖放功能时进行监听
- aws-lambda - 跨账户 AWS Cognito 授权方问题
- laravel - 如何使用元素 ui、vue js 和 laravel 将图像上传到文件夹
- pyspark - difflib.get_close_matches 的 pyspark 实现
- c# - 如何检测 Xbox One 游戏手柄指南按钮何时被按下(中间的大 X)?
- python-3.x - 循环完成后 Python 更改路径
- javascript - 如何在反应js的输入字段中插入图像?
- reactjs - React Router Link 不在自定义历史记录中保留状态
- python - 用 Python 在 Plotly 中分组图例
- python - 使用 Python Camelot 从 PDF 中提取文本框内容