Home » Open Source » Programming Interfaces » SQLDescribeCol, SQLColAttribute fail for XML column (Oracle 10,11)
SQLDescribeCol, SQLColAttribute fail for XML column [message #337280] Wed, 30 July 2008 07:40 Go to next message
letnicie
Messages: 3
Registered: July 2008
Junior Member
Hi,

I use Oracle 10 & 11 with ODBC drivers 10.02.00.01 and 11.01.00.06.
After executing "SELECT MYXMLCOL FROM MYTABLE" I call SQLNumResultCols and it tells me I have 1 column, then I call:

szColumn[ 0 ] = 0;
nSQLDataType = 0;

nRetVal = SQLDescribeCol(
hStmt,
i,
szColumn,
ICDB_ODBC_STR_LEN,
&nActualLen,
&nSQLDataType,
...
);

it returns SQL_SUCCESS_WITH_INFO and szColumn is empty, nSQLDataType is equal to zero. OK, then I call SQLGetDiagRec and it tells me:
SQLState 00000
other fields are empty.

What is going on here???
It's OK for any other type except XML!
Re: SQLDescribeCol, SQLColAttribute fail for XML column [message #337283 is a reply to message #337280] Wed, 30 July 2008 07:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the type of MYXMLCOL column?

Regards
Michel
Re: SQLDescribeCol, SQLColAttribute fail for XML column [message #337284 is a reply to message #337280] Wed, 30 July 2008 07:46 Go to previous messageGo to next message
letnicie
Messages: 3
Registered: July 2008
Junior Member
XMLTYPE
Re: SQLDescribeCol, SQLColAttribute fail for XML column [message #337285 is a reply to message #337284] Wed, 30 July 2008 07:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't think ODBC supports XMLTYPE, convert the value to a CLOB:
SELECT sys.xmltype.getclobval(MYXMLCOL) FROM MYTABLE

Regards
Michel
Re: SQLDescribeCol, SQLColAttribute fail for XML column [message #337286 is a reply to message #337280] Wed, 30 July 2008 07:51 Go to previous messageGo to next message
letnicie
Messages: 3
Registered: July 2008
Junior Member
I already do it, I just thought it can be some less tricky way...
Re: SQLDescribeCol, SQLColAttribute fail for XML column [message #337294 is a reply to message #337286] Wed, 30 July 2008 08:18 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Not until ODBC will know XMLTYPE.

Regards
Michel
Previous Topic: Oracle in OraHome92
Next Topic: Fatal error: Call to undefined function oci_connect()
Goto Forum:
  


Current Time: Fri Mar 29 05:52:23 CDT 2024