SQLColumns hangs on DB link synonym in Oracle 9.2



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@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/en-us/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 (Windows 2000), using
both Oracle 9.2.0.1.0 and 9.2.0.5.0. I'm using the Oracle ODBC driver
9.2.0.54.

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

Thanks for any help
W. Roesler
.



Relevant Pages

  • ODBC: SQLColumns hangs on DB link synonym in Oracle 9.2
    ... Oracle 9.2 database via ODBC. ... I use the SQLColumns ODBC function ... invoked on mysyn hangs forever. ...
    (comp.databases.oracle.server)
  • Re: cobol embedded sql source example
    ... The problem is, I have to work with ODBC version 2, in which the SqlColumns ... columns before I let him select that database as his current database) ... (SqlColumns when using ODBC-3 DOES return the ordinal position of each ...
    (comp.lang.cobol)
  • Re: Nameless CREATE
    ... The starting point is either an existing database or one that is ... "Describe" involves issuing an SQLDescribeCol function to ODBC ... essentially much the same as character data type apart from all 8 bits ... ALTER TABLE tablename ADD COLUMN BinaryColumn BINARY ...
    (comp.lang.forth)
  • Re: fields queries and utter disaster
    ... Unfortunately the \c ODBC DATABASE field switch is not supported in Word ... of course supports ODBC connections but Word ... Mac Word Test ... suggests that it should be possible to use query files (cf. .qry/.dqy ...
    (microsoft.public.mac.office.word)
  • Re: [VW 7.3.1] ODBCConnection
    ... I played around with a few combinations on the connection string and ... with a trusted SQL Server connection. ... there are differences for database connects. ... > any database specific odbc drivers. ...
    (comp.lang.smalltalk)