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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Question on PLSQL

Re: Question on PLSQL

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: Sun, 10 Jul 2005 22:55:16 -0400
Message-ID: <7d7c1$42d1dd83$471d7821$26556@ALLTEL.NET>


William Robertson wrote:

> Malcolm Dew-Jones wrote:
> 

>>Jack (Jack_at_ss.com) wrote:
>>: >
>>: > It's only a problem if unwrapped source code gives away stuff you don't
>>: > want people to see.
>>: >
>>: > On the other hand, wrapping source can cause problems if you do not
>>: > also include standard version reporting functions in each package or
>>: > some equivalent method of determining what exactly is installed, and
>>: > you need to support it.
>>: >
>>
>>: Is the 'version reporting functions' refering to some features of the PLSQL
>>: language?
>>
>>No (at least I don't think so).
>>
>>The following is completely untested, I have no examples with me right
>>now. (At work I have one such routine liberally cut and pasted from
>>project to project, but I haven't "looked" at it for just as long.)
>>
>>Assuming you use something like RCS, and check your files in on occasion,
>>then, in your source code add something like...
>>
>>
>>FUNCTION Version () IS VARCHAR
>>
>>BEGIN
>>
>> RETURN
>> '$RCSfile:$ $Revision:$ ' || chr(10) ||
>> 'Defines in effect:' || chr(10) ||
>> 'EXAMPLE_DEF1: &EXAMPLE_DEF1.' || chr(10) ||
>> 'EXAMPLE_DEF2: &EXAMPLE_DEF2.' || chr(10) ||
>> ' etc etc ' || chr(10) ||
>> '-- end --'
>> ;
>>END
>>
>>
>>
>>Later, you can ask the package what it is
>>
>>sql> select my_package.version() from dual;
>>
>>
>>Perhaps there's something more elegant, but I have used that for years.
>>
>>
>>--
>>
>>This space not for rent.
> 
> 
> Yes, that's the kind of thing I meant. Standard in the sense that you
> would include it in all of your packages. Standalone procedures and
> functions are harder. I'm not sure about the best way to handle object
> types with bodies but possibly they could include a static "VERSION"
> function.
> 

I've always called mine the WHOAMI() function.

So the practice is standard even if the interface is not.

-- 
Ed Prochak
running    http://www.faqs.org/faqs/running-faq/
netiquette http://www.psg.com/emily.html
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Sun Jul 10 2005 - 21:55:16 CDT

Original text of this message

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