In Oracle PL/SQL is there any way to import packages and their members?

Given a package:

create or replace package foo as
  f1 number := 1;
end;
/

Instead of:

declare
begin
  dbms_output.put_line('f1 = ' || foo.f1);
end;
/

I'd like to write:

declare
begin
  -- pseudocode not a valid PL/SQL
  import dbms_output.*;
  import foo.*;
  put_line('f1 = ' || f1);
end;
/

But how to do that ?

EDIT by Jeff: (trying to stay in the spirit of how things are done in PL/SQL)

DECLARE
  PRAGMA IMPORT dbms_output AS d;
  PRAGMA IMPORT foo AS f;
BEGIN
  d.put_line('f1 = ' || f.f1);
END;
/
6
задан Jeffrey Kemp 14 April 2011 в 04:45
поделиться