Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NULL indicator DefineByPos & StmtFetch

359765Oct 24 2002
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

1. 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.

2. 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 .
...
3. 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 is not correct. ALso the value in rcodep
is not correct. I also don't receive an OCI_SUCCESS_WITH_INFO as retcode for the OciStmtFetch()

Do I neeed another call to oci before or any ideas?

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2002
Added on Oct 24 2002
0 comments
279 views