收到错误
SQL> selectcalculator.add(10,10) from dual;
从对偶中选择calculator.add(10,10)
第 1 行的错误:
ORA-01747: 无效的 user.table.column、table.column 或列规范
SQL*Plus:2019 年 11 月 24 日星期日 13:58:08 发布 11.2.0.1.0 生产版
SQL> ed
Wrote file *afiedt.buf*
1 create or replace package body calculator
2 as
3 function add(x number, y number) return number;
4 function subtract(x number, y number) return number;
5 function multiply(x number, y number) return number;
6 function divide(x number, y number) return number;
7* end;
SQL> /
Warning: Package Body created with compilation errors.
SQL>
SQL> get pkg_bdy_cal
1 create or replace package body calculator
2 as
3 function add(x number, y number) return number
4 is
5 begin
6 return (x + y);
7 end;
8 function subtract(x number, y number) return number
9 is
10 begin
11 return (x - y);
12 end;
13 function multiply(x number, y number) return number
14 is
15 begin
16 return (x * y);
17 end;
18 function divide(x number, y number) return number
19 is
20 begin
21 return (x / y);
22 end;
23* end calculator;
SQL> /
Warning: Package Body created with compilation errors.
SQL> show error
Errors for PACKAGE BODY CALCULATOR:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
1/14 PLS-00304: cannot compile body of 'CALCULATOR' without its
specification
1/14 PLS-00905: object SYSTEM.CALCULATOR is invalid