---------a.sql
create or replace package user_info
as
procedure get_emp_info(in_empno number);
procedure get_emp_work(in_empno number);
end user_info;
/
--------b.sql
create or replace package body user_info
asprocedure get_emp_info(in_empno number)
is
store employee%rowtype;
begin
select employeeid,employeename,employeesex,employeegrade
into store.employeeid,store.employeename,store.employeesex,store.employeegrade
from employee
where employeeid=in_empno;exception
when no_data_found
then
dbms_output.put_line('该雇员编号不存在!');end get_emp_info;procedure get_emp_work(in_empno number)
is
store work%rowtype;
begin
select shopid,employeeid,month_money,work_time,start_work_date
into store.shopid,store.employeeid,store.month_money,store.work_time,store.start_work_date
from work
where employeeid=in_empno;exception
when no_data_found
then
dbms_output.put_line('该用户工作信息不存在!');end get_emp_work;end user_info;
/employee表的结构如下
名称 是否为空? 类型
----------------------------------------- -------- ------------
EMPLOYEEID NOT NULL NUMBER
EMPLOYEENAME VARCHAR2(20)
EMPLOYEESEX VARCHAR2(2)
EMPLOYEEGRADE VARCHAR2(8)work表的结构如下
名称 是否为空? 类型
----------------------------------------- -------- -------
SHOPID NOT NULL NUMBER
EMPLOYEEID NOT NULL NUMBER
MONTH_MONEY NUMBER
WORK_TIME NUMBER
START_WORK_DATE DATE声明程序包没有问题
程序包的主题有问题,我是新手 帮忙看看!
create or replace package user_info
as
procedure get_emp_info(in_empno number);
procedure get_emp_work(in_empno number);
end user_info;
/
--------b.sql
create or replace package body user_info
asprocedure get_emp_info(in_empno number)
is
store employee%rowtype;
begin
select employeeid,employeename,employeesex,employeegrade
into store.employeeid,store.employeename,store.employeesex,store.employeegrade
from employee
where employeeid=in_empno;exception
when no_data_found
then
dbms_output.put_line('该雇员编号不存在!');end get_emp_info;procedure get_emp_work(in_empno number)
is
store work%rowtype;
begin
select shopid,employeeid,month_money,work_time,start_work_date
into store.shopid,store.employeeid,store.month_money,store.work_time,store.start_work_date
from work
where employeeid=in_empno;exception
when no_data_found
then
dbms_output.put_line('该用户工作信息不存在!');end get_emp_work;end user_info;
/employee表的结构如下
名称 是否为空? 类型
----------------------------------------- -------- ------------
EMPLOYEEID NOT NULL NUMBER
EMPLOYEENAME VARCHAR2(20)
EMPLOYEESEX VARCHAR2(2)
EMPLOYEEGRADE VARCHAR2(8)work表的结构如下
名称 是否为空? 类型
----------------------------------------- -------- -------
SHOPID NOT NULL NUMBER
EMPLOYEEID NOT NULL NUMBER
MONTH_MONEY NUMBER
WORK_TIME NUMBER
START_WORK_DATE DATE声明程序包没有问题
程序包的主题有问题,我是新手 帮忙看看!
!!!
@g:\textsql\a.sql; 成功
@g:\textsql\b.sql; 警告 存在编译错误
如果有,在sqlplus执行完后使用如下命令查看一下具体错误
sql>show error;