Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Can you execute a function in an Oracle comment/hint?
How about
Execute Immediate 'Select ''/* ' || sys_context('USERENV','SESSION_USER')
|| ' */' , SysDate From Dual ;
I may not have the single quotes just right, but I'm headed for the shower, so you can do the testing. Heck, this may not even be close! ...but it looks good to me.
Hope it helps.
Jack C. Applewhite - Database Administrator Austin (Texas) Independent School District 512.414.9715 (wk) / 512.935.5929 (pager)
I'll just sit back in the shade while everyone gets laid that's what I call 'intelligent design'. -- God ("Origin of Species": Chris Smither)
"Allen, Brandon" <Brandon.Allen_at_OneNeck.com>
Sent by: oracle-l-bounce_at_freelists.org
05/03/2007 07:25 PM
Please respond to
Brandon.Allen_at_OneNeck.com
To
<oracle-l_at_freelists.org>
cc
Subject
Can you execute a function in an Oracle comment/hint?
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
-- http://www.freelists.org/webpage/oracle-lReceived on Thu May 03 2007 - 20:59:21 CDT
![]() |
![]() |