Kbase P10294: How to extract the user name from the DataServer connection parameters while connected to the foreig
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/6/2008 |
|
Status: Unverified
GOAL:
How to extract the user name from the DataServer connection parameters while connected to the foreign database.
GOAL:
How to extract the user name from the DataServer connection parameters from the meta schema while connected to the foreign database?
FACT(s) (Environment):
DataServers
All Supported Operating Systems
FIX:
The example below demonstrates the goals.
In order to get the right user name at the connection time, the -U and -P should be replaced with unknown value (?) in the _DB._Db-comm field. The _DB._Db-comm field holds the connection parameters such as -U and -P. Here are the steps to accomplish this:
There are two ways to remove the user name and the password:
1. Use for each statement:
For each _DB:
Assign _DB._db-comm = ?.
END.
OR
2. Connect to the schema holder only as a single user mode. Go to the Data Admin window select the DataServer > ORACLE Utilities > Edit Connection Information and delete the user name and password. For the MSS and ODBC DataServer, do not delete the ODBC DSN name.
3. The following code extracts the user name from the connection parameters to the foreign database.
DEF VAR vc AS CHARACTER NO-UNDO.
DEF VAR currOwner AS CHARACTER NO-UNDO.
DEF VAR vi AS INT NO-UNDO.
DO vi = 1 TO NUM-ENTRIES( DBPARAM( "<logical_name>" ) ) :
vc = ENTRY( vi, DBPARAM( "<logical_name>" ) ).
/* MESSAGE vc VIEW-AS ALERT-BOX. */
IF INDEX( vc, '-U' ) <> 0 THEN
DO:
currOwner = SUBSTRING( vc, 4 ).
MESSAGE currOwner VIEW-AS ALERT-BOX.
LEAVE.
END.
END.