在Oracle PL / SQL中,有什么方法可以导入软件包及其成员吗?

| 给定一个包:
create or replace package foo as
  f1 number := 1;
end;
/
代替:
declare
begin
  dbms_output.put_line(\'f1 = \' || foo.f1);
end;
/
我想写:
declare
begin
  -- pseudocode not a valid PL/SQL
  import dbms_output.*;
  import foo.*;
  put_line(\'f1 = \' || f1);
end;
/
但是该怎么做呢? Jeff的编辑:(试图保持在PL / SQL中完成事情的精神)
DECLARE
  PRAGMA IMPORT dbms_output AS d;
  PRAGMA IMPORT foo AS f;
BEGIN
  d.put_line(\'f1 = \' || f.f1);
END;
/
    
已邀请:
很简单,您不能。抱歉,没有其他答案!     
当然可以! :) 有点...
declare
  procedure put_line (p in varchar2) is begin dbms_output.put_line(p); end;
  function f1 return number is begin return foo.f1; end;
begin
   put_line(\'f1 = \' || f1);
end;
/
    

要回复问题请先登录注册