Subject [IBO] How to store a SET into Firebird with IBO?
Author G. Nau
Ramil,
using the Hex version sounds pretty cool and simple to me. I think I'll
give that a try ...

Thanks
Gunther

Am 7 Jul 2005 um 16:38 hat Ramil geschrieben:

> 8 Integers is shortest variant - 32 bytes.
> You can also store INT8 array in one Varchar field
> having executed corresponding transformation.
>
> IB_Query1.FieldByName('MYSET').AsString:=S;
>
> 1. As '0' and '1'
> S:='01000111010101111000110001010...
> Up to 256 bytes
> 2. As HEX
> S:='4A7854E038587D679000493380...
> Up to 64 bytes
> 3. UUEncode or Base64
> S:='PD94bWwgdmVy...
>
> Regards,
> Ramil
>
> > Hello
> > Try 8 Integer fields (or 4 Int64 as you wish)
>
> > type
> > PByteSet = ^TByteSet;
> > TByteSet = set of Byte;
>
> > var
> > INT8: Array[1..8] of Integer;
> > MySet,MySet2: TByteSet;
>
> > ...
> > //write
> > PByteSet(@INT8)^:=MySet;
> > IB_Query1.FieldByName('SET1').AsInteger:=INT8[1];
> > IB_Query1.FieldByName('SET2').AsInteger:=INT8[2];
> > ...
> > IB_Query1.FieldByName('SET8').AsInteger:=INT8[8];
>
> > ...
> > //read
> > INT8[1]:=IB_Query1.FieldByName('SET1').AsInteger;
> > INT8[2]:=IB_Query1.FieldByName('SET2').AsInteger;
> > ...
> > INT8[8]:=IB_Query1.FieldByName('SET8').AsInteger;
> > MySet2:=PByteSet(@INT8)^;
>
> > Ramil
>
> >> I have three differents SETs in my Delphi application, I'd like to store
> >> in a Firebird Table
>
> >> 1.) What datatype is appropriate to store it?
> >> 2.) What do you recommend for converting the SET into the Firebird
> >> compatible datatype?
>
> >> Regards
> >> Gunther
>
>
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>
>







___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de