Menu

OCI_GetInt changed

2008-05-07
2012-09-26
  • Josemi Antelo

    Josemi Antelo - 2008-05-07

    Hello

    There is a change between v2.3 and v2.4 in OCI_GetInt that causes an error in my code. Before, in v2.3 if Oracle table col type was a text, OCI_GetInt try an impicit conversion but now with v2.4 not Why?. Now I must to do the conversion in my own code?

    Josemi

     
    • Josemi Antelo

      Josemi Antelo - 2008-05-07

      Hello again ...

      I just see it, in the function OCI_GetDouble, you do the implicit conversion:

              case OCI_CDT_TEXT:
      
                  return dtstod((const dtext *) data, NULL);
      

      With double yes but with Integer not

       
      • Vincent Rogier

        Vincent Rogier - 2008-05-07

        yes because double are handled differently from integers...

         
    • Vincent Rogier

      Vincent Rogier - 2008-05-07

      Hello Josemi,

      Wihtin v2.4.0, the internal number handling was deeply modified in order to handle all kind of number : 16 bits, 32 bits and 64 bits, in their signed an unsigned version.

      The implicit conversion provided up to v2.3.0 was convinient only for signed 32bits integers.
      Adding support for portable string conversion for all other integers types across all possible platforms is not really easy because of the difference of libc implementations (eg. Miscrosoft !!).

      So, i decided to remove the implicit conversion from int to string in OCI_GetString(). I probably will put it back later (in 3.0.0 maybe)

      But once again, it was clearly announced in the change log of version 2.4.0 :

      ...
      * Miscelleanous changes
      ...
      - Removed : implicit conversion from text to integers in OCIGetxxxIntxx() calls
      ...
      ...

      ChangeLogs are made to be read !

      And, yes, now, you have to do the conversion....

      Vincent.

       
    • Josemi Antelo

      Josemi Antelo - 2008-05-07

      Once more ... You're right. We swear that already had read the documentation and the changelog, it looks that I ignored, I'm sorry.

      I urge you to at least leave as soon as ... :-)

              case OCI_CDT_TEXT:
      
                  return (int) dtstol((const dtext *) data, NULL, 10);
      

      Thank you for your patience :-)