ODBC: SQLColumns hangs on DB link synonym in Oracle 9.2
- From: Wolfram Roesler <wr@xxxxxxx>
- Date: Fri, 22 Jul 2005 11:42:05 +0200
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, 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
.
- Prev by Date: Re: Converting oracle table's data into csv on client computer
- Next by Date: Re: Preferred Application Server
- Previous by thread: Converting oracle table's data into csv on client computer
- Next by thread: Best practices for doing a backup of/from standby database
- Index(es):
Relevant Pages
|