OCI DefineByPos
From: pym <pierre-yves.michaud_at_eds.com>
Date: Mon, 21 Oct 2002 15:45:53 +0200
Message-ID: <3db4045f$0$721$5402220f_at_news.sunrise.ch>
I am using OCI to connect my Application to an Oracle 8 Server. I am trying now to make a simple select like a <select * from ..> , try to retrieve the rowinfo and the rows
Date: Mon, 21 Oct 2002 15:45:53 +0200
Message-ID: <3db4045f$0$721$5402220f_at_news.sunrise.ch>
I am using OCI to connect my Application to an Oracle 8 Server. I am trying now to make a simple select like a <select * from ..> , try to retrieve the rowinfo and the rows
- retrieving the columncount AttrGet: statementHandle asParameter handletype: OCI_HTYPE_STMT asParameter attributevalue: longBuffer asParameter size: 0 asParameter attributtype: OCI_ATTR_PARAM_COUNT asParameter errorHandle: errHandle asParameter.
- Retrieving the column infos for all columns ret := ociDLL oCIParamGet: statementHandle asParameter htype: OCI_HTYPE_STMT asParameter errorHandle: errHandle asParameter parameterHandle: longBuffer asParameter pos: i asParameter . (ret == OCI_SUCCESS) ifFalse: [ociDLL oCIErrorGet: errHandle type: OCI_HTYPE_ERROR ]. parameterHandle := longBuffer csContext . ret := ociDLL oCIAttrGet: parameterHandle asParameter handletype: OCI_DTYPE_PARAM asParameter attributevalue: longBuffer2 asParameter size: 0 asParameter attributtype: OCI_ATTR_NAME asParameter errorHandle: errHandle asParameter. colname := (String fromAddress: longBuffer2 contents ) trimBlanks . ...
- setting the defineByPos
ret := ociDLL oCIDefineByPos: statementHandle asParameter defineHandle: defineHandle asParameter errHandle: errHandle asParameter position: i asParameter value: val asParameter valuesize: (rowDescr getMaxLen: i) asParameter datatype: (rowDescr getType: i) asParameter indicatorpointer: ind asParameter rlenp: 0 asParameter rcodep: err asParameter mode: OCI_DEFAULT asParameter.
My select has NULL values, i tried to used the indicator pointer to catch that, but the value I have in it are not correct. ALso the value in rcodep are not correct.
Do I neeed another call to oci before or any ideas?
Thanks in advance Received on Mon Oct 21 2002 - 15:45:53 CEST