Column Name Type(full) Type Length Prec. Scale Null
------------------------------- -------------------------------------------
EMPNO NUMBER(4) ? 22 4 0 N
ENAME VARCHAR(10) ? 10 0 0 Y
JOB VARCHAR(9) ? 9 0 0 Y
MGR NUMBER(4) ? 22 4 0 Y
HIREDATE DATE ? 7 0 0 Y
SAL NUMBER(7,2) ? 22 7 2 Y
COMM NUMBER(7,2) ? 22 7 2 Y
DEPTNO NUMBER(2) ? 22 2 0 Y
Source code
#include"ocilib.h"intmain(void){OCI_Connection*cn;OCI_TypeInfo*tbl;inti,n;if(!OCI_Initialize(NULL,NULL,OCI_ENV_DEFAULT))returnEXIT_FAILURE;cn=OCI_ConnectionCreate("YDL01","SCOTT","tiger",OCI_SESSION_DEFAULT);tbl=OCI_TypeInfoGet(cn,"EMP",OCI_TIF_TABLE);if(tbl!=NULL){printf("Column Name Type(full) Type Length Prec. Scale Null\n");printf("------------------------------- -------------------------------------------\n");n=OCI_TypeInfoGetColumnCount(tbl);charstr[100];for(i=1;i<=n;i++){OCI_Column*col=OCI_TypeInfoGetColumn(tbl,i);OCI_ColumnGetFullSQLType(col,str,100);printf("%-20s%-20s%-10s%-8i%-8i%-8i%-s\n",OCI_GetColumnName(col),str,OCI_GetColumnSQLType(col),OCI_GetColumnSize(col),OCI_GetColumnPrecision(col),OCI_GetColumnScale(col),OCI_GetColumnNullable(col)==TRUE?"Y":"N");}}OCI_Cleanup();returnEXIT_SUCCESS;}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Question
Hello
I have a problem/question about "OCI_GetColumnSQLType" call.
When I use "OCI_GetColumnSQLType", I get "?" and when I use "OCI_ColumnGetFullSQLType" I get correct result (full description).
My question.
Is there a problem with "OCI_GetColumnSQLType"?
Is it "deprecated"?
Do I make a mistake?
Thanks for your answer (and your work!)
Ydl
Info
Result
Source code
Hi,
This is a bug introduced in v4.0.0
Already fixed in the GIT repository few weeks ago.
Best regards,
Vincent
Thanks very much!
Ydl