Get database name from path
Author: jason_zuvela@yahoo.com (jasonzuvela)
hi hi
Is there any way to retrieve the database name from a path entry in the ASN file?
So far I have only found $user and $password, but they don't help me at all. The only options I can see now are either setting a logical or saving it somewhere in the database. Though, this is quite redundant, after the database connection has already been setup.
Thanks
3 Comments
Local Administrator
Hi Jason,
as you may know, there are a lot of redirections possible in an ASN file.
More if you use UROUTER and other remote dataaccesses.
So I recommend to have a common table like "DB_PROPERTIES"
in each of your databases allowing the storage of key-value pairs.
sql "select .... from DB_PROPERTIES","$mydbpath"
get infos from each of your databases denoted by $mydbpath.
This way, the information is stored within the database no matter how often you redirect paths in the ASN.
I used this during a testing phase of a new application
to distinguish between test-data and production database.
Success, Uli
Author: ulrich-merkel (ulrichmerkel@web.de)
Local Administrator
Not sure if this is helpful ...
Oracle database, assuming correct permissions on systables ...
sql "select NAME from sys.v_$DATABASE", "DEF"
will give you the database name. Other databases might have similar functions
Author: Rick Scally (rickscally@aol.com)
Local Administrator
Hi Rick
Are you sure about "v_$DATABASE", should it not be "V$DATABASE" ?
For MSS, the sql statement is "SELECT DB_NAME()"
Ingo
Author: istiller (i2stiller@gmx.de)