This discussion is archived
0 Replies Latest reply: Sep 10, 2013 11:31 PM by RamuMLG RSS

SQLColAttribute for attribute SQL_DESC_TYPE_NAME on a user-defined data type does not show type name.

RamuMLG Newbie
Currently Being Moderated

Hi,


I have created a user-defined data and trying to fetch its data type using SQLColAttribute(SQL_DESC_TYPE_NAME). But I dont see any values in return.

Is something wrong with Oracle ODBC  Driver?


Output using ODBCTest application:

SQLColAttribute:

                In:                StatementHandle = 0x005E31E0, ColumnNumber = 1, FieldIdentifier = SQL_DESC_TYPE_NAME=14, CharacterAttributePtr = 0x0BD40020, BufferLength = 999, StringLengthPtr = 0x00231BA8, NumericAttributePtr = 0x0020AF60, fFieldIndentifier Type = SQL_C_CHAR=1

                Return:    SQL_SUCCESS=0

                Out:            *CharacterAttributePtr = "DECIMAL", *StringLengthPtr = 7, *NumericAttributePtr = <unmodified>

                TST1001: Buffer NumericAttributePtr was not updated.

SQLColAttribute:

                In:                StatementHandle = 0x005E31E0, ColumnNumber = 2, FieldIdentifier = SQL_DESC_TYPE_NAME=14, CharacterAttributePtr = 0x0BD40020, BufferLength = 999, StringLengthPtr = 0x00231BA8, NumericAttributePtr = 0x0020AF60, fFieldIndentifier Type = SQL_C_CHAR=1

                Return:    SQL_SUCCESS_WITH_INFO=1

                Out:            *CharacterAttributePtr = "", *StringLengthPtr = 0, *NumericAttributePtr = <unmodified>

                TST1001: Buffer NumericAttributePtr was not updated.

                stmt:        szSqlState = "01004", *pfNativeError = 0, *pcbErrorMsg = 43, *ColumnNumber = -2, *RowNumber = -2

                                        MessageText = "[Oracle][ODBC]String data, right truncated."


Steps to reproduce the issue:

CREATE TYPE external_person AS OBJECT ( name VARCHAR2(30), phone VARCHAR2(20) )

CREATE TABLE MyTbl1 (C01 INTEGER , C02 external_person)

insert into mytbl1 values  ( 1,external_person('xxx', 1234 ) )

select * from mytbl1

SQLColAttribute(SQL_DESC_TYPE_NAME) on col1 -- success with all information

SQLColAttribute(SQL_DESC_TYPE_NAME) on col1 -- success_with_info with no information.


Other details:

Oracle Driver version: 11.01.00.07

Oracle Database: 11g


/Ramu

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points