php-firebird icon indicating copy to clipboard operation
php-firebird copied to clipboard

Implementing INT128 (FB 4.0 feature)

Open MartinKoeditz opened this issue 1 year ago • 1 comments

I struggle with the new INT128 datatype. PHP supports 64 bit. For the INT128 I wanted to use (output) it as a string. But currently I'm unable to use the correct Firebird API / ISC.

Any help is welcome.

MartinKoeditz avatar Mar 26 '24 16:03 MartinKoeditz

On 3/26/24 19:05, Martin Köditz wrote:

I struggle with the new INT128 datatype. PHP supports 64 bit. For the INT128 I wanted to use (output) it as a string. But currently I'm unable to use the correct Firebird API / ISC.

Any help is welcome.

There are 2 ways to solve a problem:

  • use dedicated interface

    class IInt128     {         virtual void toString(StatusType* status, const FB_I128* from, int scale, unsigned bufferLength, char* buffer) = 0;         virtual void fromString(StatusType* status, int scale, const char* from, FB_I128* to) = 0;     }; // for details see doc/Using_OO_API.html

  • cast values, the simplest way for it is to ask server to change int128 values to strings     set bind of int128 to varchar;   (this is SQL form), preferred for you way is to use DPB, tag isc_dpb_set_bind, string value "int128 to varchar".

AlexPeshkoff avatar Mar 27 '24 08:03 AlexPeshkoff