Recent News

PL/SQL tables IN parameters bug reported

Posted by Vincent Rogier on August 15th, 2008

A bug was reported when binding host arrays to PL/SQL tables parameters of PL/SQL procedures.

This affects only pure IN parameter mode. When using OUT or IN/OUT, everything is working fine.

This bug gives an ORA-01403 when accessing the PL/SQL table parameter from inside the PL/SQL procedure.

This will be fixed in the next release (2.5.2 or 2.6.0).

You can patch the actual version (2.5.1) like this :

in ocilib.c, line 2451, was :

       pnbelem       = &bnd->plnbelem;

and it should be :

        bnd->plnbelem = nbelem;
        pnbelem       = &bnd->plnbelem;

OCILIB Next Release features

Posted by Vincent Rogier on August 9th, 2008

I’m currently working on a list of new features for the next release of OCILIB.

Initially, I was focused on extending object API support, thread contextual error handing and Events support.

OCILIB already has some support for objects but not for collections and references.
Implementing theses features is a lot of work and i’ll reserve it for the branch version v3.x.

So, for branch v2.x, at the moment, i’m thinking to focus on :

  • Session Pools (>=10g)
  • Events (>=8i)
  • Implicit fetch of rowid (>=11g)
  • Statement cache (=>9i)
  • Scrollable cursors (>= 9i)
  • Lob tuning (prefetch size, chunck size, internal array allocation) (>=11g)

If you have any comments, ideas for OCILIB new functionalities, just let me know !

Calling PL/SQL procedures with PL/SQL tables parameters

Posted by Vincent Rogier on August 6th, 2008

Since version 2.5.0, OCILIB handles PL/SQL tables for input/output binds when calling PL/SQL procedures.

Because PL/SQL tables are arrays, binding C arrays to a PL/SQL call is implemented in OCILIB though the OCI_BindArrayXXXX() functions.

Thoses functions were initially designed for the array interface (bulk operations). In this context, all arrays binded to a statement must have the same size. This size is set by calling OCI_BindArraySetSize().

But in the context of PL/SQL tables binds, each bind (each array) is independent and can have it own size.

That why, in 2.5.0, i introduced an extra params to all of the OCI_BindArrayXXX() calls in order to specify the size of the array for PL/SQL tables binds.

For regular bulk operations, this extra param is not used and must be set to 0.

Because PL/SQL tables binds have their own array size specified with the new last param (’nbelem’) of OCI_BindArrayXXX() call, OCI_BindArraySetSize() MUST not be called.

A little summary:

For bulk operations :

  • prepare statement with OCI_Prepare()
  • set array size with OCI_BindArraySetSize()
  • bind C arrays with OCI_BindArrayXXX() with 0 for param ‘nbelem’
  • execute statement with OCI_Execute()

For PL/SQL procedure call with PL/SQ/ tables binds :

  • prepare statement with OCI_Prepare()
  • bind C arrays with OCI_BindArrayXXX() specifying each array size with param ‘nbelem’
  • execute statement with OCI_Execute()

The OCILIB documentation and changelog were not clear about that point.

Next release will improve the documentation.

Recent Comments | Recent Posts

Copyright © OCILIB | OCILIB Logo designed by WolfHound (Developpez.com)
Theme based on Wordpress AngelicDesign by: Website Builder
bottom