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

Home -> Community -> Mailing Lists -> Oracle-L -> Can you execute a function in an Oracle comment/hint?

Can you execute a function in an Oracle comment/hint?

From: Allen, Brandon <Brandon.Allen_at_OneNeck.com>
Date: Thu, 3 May 2007 16:36:53 -0700
Message-ID: <04DDF147ED3A0D42B48A48A18D574C45071FDBFC@NT15.oneneck.corp>


I'm pretty sure I saw someone demonstrate the syntax for this before, but I've looked everywhere and can't find it now. What I'm trying to do is execute a function in the in-line comment of a query, like this:  

select /* sys_context('USERENV', 'SESSION_USER') */ sysdate from dual;

But, it's not working. The above query gets executed, but the sys_context function is not being executed, it's just being treated as a comment. What I want is for this query to show up as:

select /* SCOTT */ sysdate from dual

In v$sql.sql_text.

Is this possible, or am I just imagining having seen this before?

Thanks,
Brandon

Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.

--
http://www.freelists.org/webpage/oracle-l
Received on Thu May 03 2007 - 18:36:53 CDT

Original text of this message

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