Hello, I have two OCILIB questions.
1) I installed OCILIB last year and have been happily using it. Now I see there is a new release with some features I'd like to use. If I wish to install the latest release, what is the procedure? That is, do I need to un-install anything? Or, do I simply follow the original installation instructions again, as documented in the OCILIB User Guide (and OCILIB with take care of itself)?
2) I don't see mention of BINARY_DOUBLE in the OCILIB User Guide, or anywhere else. Suppose I have a table in Oracle 11.2 database, with a column that is BINARY_DOUBLE datatype, and I use a PL/SQL stored procedure to select data from that column and place it, for example, in a variable out_data. When I retrieve out_data into the C variable myData using the following lines,
double myData=0;
...
OCI_Prepare(st, "begin get_my_data(:out_data); end;")
OCI_BindDouble(st, ":out_data", &myData);
OCI_Execute(st);
will OCILIB convert the PL/SQL BINARY_DOUBLE variable out_data to Number datatype? Or, will OCILIB simply take the BINARY_DOUBLE variable out_data and map it exactly (via IEEE 754) into the C variable myData which is double datatype? I'm hoping there is a straight mapping to double so there's no conversion to Number that introduces conversion errors. If OCILIB does first convert to Number, is there a workaround?
I also have this same question for OCI_BindArrayOfDoubles.
I would think Oracle's Numerical Precedence would prevent conversion to Number, since it first looks at whether the variables involved are BINARY_DOUBLE and should therefore not convert to Number since out_data is BINARY_DOUBLE and myData is double. But I really have no idea what OCILIB is doing.
-----------------------------------------------------------
The following is from Oracle documentation:
Numeric Precedence Numeric precedence determines, for operations that support numeric datatypes, the datatype Oracle uses if the arguments to the operation have different datatypes. BINARY_DOUBLE has the highest numeric precedence, followed by BINARY_FLOAT, and finally by NUMBER. Therefore, in any operation on multiple numeric values:
•If any of the operands is BINARY_DOUBLE, then Oracle attempts to convert all the operands implicitly to BINARY_DOUBLE before performing the operation.
•If none of the operands is BINARY_DOUBLE but any of the operands is BINARY_FLOAT, then Oracle attempts to convert all the operands implicitly to BINARY_FLOAT before performing the operation.
•Otherwise, Oracle attempts to convert all the operands to NUMBER before performing the operation.
|