Re: Executing Procedures

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Wed, 15 Feb 2012 20:07:36 +0000 (UTC)
Message-ID: <jhh3a8$qg4$1_at_solani.org>



On Wed, 15 Feb 2012 19:21:09 +0100, Gerard H. Pille wrote:
> Mladen Gogala wrote:

>>
>> There is also a way for procedure to answer the questions like: who am
>> I?
>> What is my purpose? What is the answer to the question of life,
>> universe and everything? What is an airspeed velocity of an unladen
>> swallow?
>> Every PL/SQL object has the global VARCHAR2 variable $$PLSQL_UNIT which
>> will return its name:
>>
>> 1 create or replace function tkyte_demo return varchar2
>> deterministic 2 as 3 begin 4 return($$PLSQL_UNIT);
>> 5* end;
>> SQL> /
>>
>> Function created.
>>
>> SQL> select tkyte_demo from dual;
>>
>> TKYTE_DEMO
>>


>> TKYTE_DEMO
>>
>> There is also a variable called $$PLSQL_LINE.
>>
>>
>>
>>

> How refreshing, something I didn't know. Thanks! Is this documented > somewhere?

Yes, this is right in the PL/SQL manual. This is a 10G new feature, called "conditional compilation". This is from the "inquries" section.

http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/ fundamentals.htm#BABIHIHF

-- 
http://mgogala.byethost5.com
Received on Wed Feb 15 2012 - 14:07:36 CST

Original text of this message