Menu

Question about OCI_BindSetNullAtPos

rovshan
2013-03-28
2013-12-22
  • rovshan

    rovshan - 2013-03-28

    Hi,

    I'm using OCILIB array bind functions (OCI_BindArrayOfDates, OCI_BindArrayOfStrings etc. in external bind mode - i.e. allocating arrays myself) in order to submit data to database along with anonymous PL/SQL block and have it do some work on database side to minimize roundtrips. I set array size to 50 and then start fetching records from one database and send to another one. I noticed that (may be wrongly) if I call OCI_BindSetNullAtPos once on some position, value of that parameter at that position remains NULL (as param value on database side) across calls. So I wanted to ask is there any function that does reverse of OCI_BindSetNullAtPos? That is tells OCILIB that this parameter at this position is no longer null. Or should I avoid calling this function and set pointer to 0 at that position when I want to send null? What would you recommend?

    Thank you very much in advance!

    Best Regards,
    Rovshan

     
    • Vincent Rogier

      Vincent Rogier - 2013-03-28

      Hi,

      You've pointed there a weakness in the design. Yes, once an entry has been
      set to NULL , it remains NULL for scalar types. For handled based (lob,
      date, ....) the indicator is recomputed before each execution. And there is
      no possibility to revert the indicator for scalar types.....
      I will need to add a new call to allow reverting the indicator status in
      next release.

      regards,

      vincent

       

      Last edit: Vincent Rogier 2013-03-28
  • Anonymous

    Anonymous - 2013-03-28

    Thank you very much!
    I will get it when you do a release.
    For now I will work on other parts of application.

    Thanks again.
    Best Regards,
    Rovshan

     
  • Anonymous

    Anonymous - 2013-03-28

    One quick question:
    You noted that for handle based types indicator is recomputed before each excution. If I use date array in following order:
    1 - set value at some position in array
    2 - execute
    3 - mark position set in step 1 as null
    4 - execute

    In step 4 will it use null value or value remaning in array from step 1?

    Thank you!
    Rovshan

     
  • rovshan

    rovshan - 2013-09-23

    Hi,

    I read that you are preparing to release C++ API for OCILIB. This is really great news. If it is not too hard to implement could you please, also add OCI_BindSetNotNullAtPos function to C API? I have almost finished my application and waiting for this function to be added because it will fix bugs in 2 modules of my application.

    Thanks you in advance!
    Rovshan

     
  • Vincent Rogier

    Vincent Rogier - 2013-09-24

    Hi,

    OCI_BindSetNotNull() and OCI_BindSetNotNullAtPos() committed in the SF.NET trunk

    Revision: 184

    Regards,

    Vincent