Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using BigInts as output parameters from procedure calls. #28

Closed
lhebblethwaite opened this issue Feb 3, 2016 · 1 comment
Closed
Assignees

Comments

@lhebblethwaite
Copy link

There is a problem using BinInt typed items to return OUT parameters of stored procedures.

Example procedure:
create or replace procedure test_big_int(value_in in number, value_out out number) is
begin
value_out := value_in;
end;

Example C code:

big_int bi = 0;
OCI_Prepare(st, "begin test_big_int(45, :1); end;");
OCI_BindBigInt(st, ":1", &bi);
OCI_Execute(st);

With the procedure call in the form shown above ("begin proc(...); end;") the bi variable is updated.

However, if the procedure call is changed to the otherwise equivalent "call proc(...)" the bi variable is not updated.

@vrogier
Copy link
Owner

vrogier commented Feb 3, 2016

Hi,

There is a bug in OCILIB when using the "CALL" keyword.
OCI is automatically updating output bind buffers for scalar types (int, float, double, strings, dates) as OCILIB passes host variables address directly to OCI.
For non scalar types (all handle based types such as lobs, timestamps, .... + big int), OCILIB is passing internal pointers and then must update them after statement execution.
It updates output bind buffers only when it is a PL/SQL call as other SQL statement types do not modify host variables.
When a SQL statement is parsed, OCILIB retrieves its type from OCI. Oracle has recently added a new constant value for "CALL" statements.
OCILIB was checking against "BEGIN" and "DECLARE" statement types only as the "CALL" type was not exposed by OCI in previous Oracle Releases.
The fix consist in adding the "CALL" type in the list of types that identifies a SQL statement as a PL/SQL statement

@vrogier vrogier closed this as completed in b45cb9c Feb 3, 2016
@vrogier vrogier self-assigned this Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants