Jump to content


Photo
- - - - -

SQL_DBNAME


3 replies to this topic

#1 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 12 July 2007 - 02:53 AM

Hi,

Is there a environment variable in PROIV to return the SQL_DBNAME? I want to write something depends on the Oracle SID the user is logging in. For example I have PROD and TEST DB where my function needs to distinguish if user is in PROD or TEST environment.

Thanks,

Vol

#2 Paul Blew

Paul Blew

    Member

  • Members
  • PipPip
  • 24 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 12 July 2007 - 07:43 AM

Hi Vol

I don't know whether it's possible to retrieve SQL_DBNAME using &$@~SQL_DBNAME, but if it isn't the following Oracle SQL may help.

SELECT sys_context('USERENV','DB_NAME') FROM DUAL;


Other parameters for sys_context are listed at: http://www.techonthe...sys_context.php

Hope this helps.

Paul

#3 Rob_Stebbens

Rob_Stebbens

    Member

  • Members
  • PipPip
  • 30 posts
  • Gender:Male

Posted 12 July 2007 - 09:39 AM

Hi Vol

I don't know whether it's possible to retrieve SQL_DBNAME using &$@~SQL_DBNAME, but if it isn't the following Oracle SQL may help.

SELECT sys_context('USERENV','DB_NAME') FROM DUAL;


Other parameters for sys_context are listed at: http://www.techonthe...sys_context.php

Hope this helps.

Paul


SQL_DBNAME works for me, as does :

$BOOTS = &$@~PROPATH
$DATA = &$@~PRODATA
$DB = &$@~SQL_DBTYPE
$SQL_USER = &$@~SQL_USERNAME

Cheers

#4 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 13 July 2007 - 07:07 AM

Thank you all!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users