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 -> ODBC: SQLColumns hangs on DB link synonym in Oracle 9.2

ODBC: SQLColumns hangs on DB link synonym in Oracle 9.2

From: Wolfram Roesler <wr_at_spam.la>
Date: Fri, 22 Jul 2005 11:42:05 +0200
Message-ID: <Xns969B770A49412wrgrpde@62.153.159.134>


Hello,

I have a peculiar problem with a Windows program that accesses an Oracle 9.2 database via ODBC. I use the SQLColumns ODBC function to query the table layout from the database, and it works fine for all tables but hangs when invoked on a synonym pointing to a database link. The link and synonym are nothing special:

	create database link mylink
	    connect to remoteuser identified by remotepasswd
	    using 'remotename';
	create synonym mysyn for mytable_at_mylink;

I can then "select * from mysyn" and "describe mysyn" in sqlplus, and select from mysyn using ODBC calls. However, SQLColumns when invoked on mysyn (or MYSYN) hangs forever. On another database, it hangs for three minutes but doesn't output anything (SQLFetch returns SQL_NO_DATA_FOUND immediately).

I'm invoking SQLColums like this (error handling omitted):

  SQLSetStmtAttr(hstmt,SQL_ATTR_METADATA_ID,

      reinterpret_cast<SQLPOINTER>(1),NULL);   SQLColumns(hstmt,

      NULL,0,
      NULL,SQL_NTS,
      (unsigned char*)"MYSYN",SQL_NTS,
      NULL,0);

Leaving the SQLSetStmtAttr away doesn't help.

I built the ODBC test program available from Microsoft at http://msdn.microsoft.com/library/default.asp?url=/library/enus /vcsample/html/_sample_mfc_CATALOG.asp
and modified it to use SQLColumns on "MYSYN". The result is that it hangs for a couple of seconds and then says "ORA-01013: user requested cancel of current operation".

These all sound very strange to me. I can use SQLColumns successfully on all tables and views, the problem occurs with synonyms only.

The problem is occuring on the DB server itself, using both Oracle 9.2.0.1.0 and 9.2.0.5.0. The ODBC driver is 9.2.0.54.

Did anyone ever encounter similar problems? Any idea what to do?

Thanks for any help
W. Roesler Received on Fri Jul 22 2005 - 04:42:05 CDT

Original text of this message

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