Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Get database name in OCI or Transact-SQL

Get database name in OCI or Transact-SQL

From: Michael Chen <michaelc7_at_earthlink.net>
Date: Mon, 30 Sep 2002 18:55:44 GMT
Message-ID: <Q61m9.1053$OB5.100694@newsread2.prod.itd.earthlink.net>


Hello,

In Oracle 8i, function OCIDescribeAny can return OCI_PTYPE_DATABASE type information such as OCI_ATTR_CURSOR_COMMIT_BEHAVIOR and OCI_ATTR_LIST_SCHEMAS. To get the handle from OCIDescribeAny for a database, you need to pass the database name:

http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a89857/oc i15r32.htm
also

http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a89857/oc i06des.htm#444119

The problem is my OCI connection may not have prior knowledge of the database name. What is passed to function OCIServerAttach may be just the TNS alias name defined in tnsnames.ora. Is there any way in OCI or Transact-SQL for me to get the database name after the connection is established?

Thank for your help.

--Michael Received on Mon Sep 30 2002 - 13:55:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US