create or replace package scott.pk_wt is
type mytype is ref cursor;
procedure UNFOLDBOM_LAST(mycs out mytype);
end;
CREATE OR REPLACE package BODY SCOTT.pk_wt is
procedure UNFOLDBOM_LAST(mycs out mytype) is
begin
open mycs for
select * from BMS_BOM; --出问题的部分 end;
end;
最近一个项目要用到建包,上面是我写的一段建包程序,为什么到上面select * from bms_bom部分总是提示表或视图不存在,那个表实际是存在的,请教。
type mytype is ref cursor;
procedure UNFOLDBOM_LAST(mycs out mytype);
end;
CREATE OR REPLACE package BODY SCOTT.pk_wt is
procedure UNFOLDBOM_LAST(mycs out mytype) is
begin
open mycs for
select * from BMS_BOM; --出问题的部分 end;
end;
最近一个项目要用到建包,上面是我写的一段建包程序,为什么到上面select * from bms_bom部分总是提示表或视图不存在,那个表实际是存在的,请教。
试试
建的包名前的用户scott去掉,在编译一下看看。create or replace package pk_wt is
type mytype is ref cursor;
procedure UNFOLDBOM_LAST(mycs out mytype);
end;
CREATE OR REPLACE package BODY pk_wt is
procedure UNFOLDBOM_LAST(mycs out mytype) is
begin
open mycs for
select * from BMS_BOM; end;
end;
前面是schema的名字create or replace package schemaName.packageName
...
包头名和包体名可以加schema名的如果楼主对SCHEMA和USER不了解的话可以参考下面的文章
http://blog.csdn.net/wh62592855/archive/2009/09/27/4599333.aspx