Quote:
|
Originally Posted by Gumby
Hey,
I want to get the database name in a PL/SQL trigger.
At the SQLPlus prompt, these are some examples I've tried:
fsdevl75@fsdev> select sys_context('userenv', 'db_name') from dual;
SYS_CONTEXT('USERENV','DB_NAME
---------------------------------------------------------------------------
13
fsdevl75@fsdev> select '&_CONNECT_IDENTIFIER' from dual;
old 1: select '&_CONNECT_IDENTIFIER' from dual
new 1: select 'fsdev' from dual
'FSDEV'
--------------------------------
fsdev
fsdevl75@fsdev> desc v$database;
ERROR:
ORA-04043: object "SYS"."V_$DATABASE" does not exist
I want what _CONNECT_IDENTIFIER returns (fsdev in this case), but I can't figure out any way to do this in a trigger. Can anybody help with this?
|
Hey,
I would probably see if i could do a SELECT INTO into a var, then return the var (or do what ever you want with the results).
here's a example on SELECT INTO:
http://www.postgresql.org/docs/8.1/i...QL-SELECT-INTO