Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Include File in PL/SQL?

Re: Include File in PL/SQL?

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 28 Jan 2007 09:44:53 -0800
Message-ID: <1170006290.569435@bubbleator.drizzle.com>


Michael42 wrote:
> Thanks for all you replies.
>
> There are many ways to skin this cat as you all pointed out.
>
> * Place this type info in a table.
> * Pin the table to memory if performance issue.
> * Place it in a file via DIRECTORY_OBJECT or UTIL_FILE dir.
>
> I guess what you are all implying is THE CONSTRUCT OF INCLUDE FILES IN
> STANDARD PROCEDURES and FUNCTIONS CANNOT BE DONE IN ORACLE 10g. :-)
>
> Thanks all,
>
> Michael42

Sure it can. But the point of my original post is that I can not think of why you would want to write a stand-alone procedure rather than put your procedural code into a package.

But Ok ... you want an include ... pretty simple actually:

CREATE OR REPLACE FUNCTION include_func (val1 OUT VARCHAR2, val2 OUT DATE) RETURN BOOLEAN IS BEGIN
   val1 := 'Test';
   val2 := SYSDATE+1;
   RETURN TRUE;
END include_func;
/

set serveroutput on

DECLARE
  myval1 VARCHAR2(20);
  myval2 DATE;
  x BOOLEAN;
BEGIN
   x := include_func(myval1, myval2);

   dbms_output.put_line(myval1);
   dbms_output.put_line(myval2);
END;
/

But I can think of a single reason why I would use this construct in place of the initialization section of a package.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sun Jan 28 2007 - 11:44:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US