Subject Re: RES: [IBO] IBO + OCTETS FIELD
Author personalsoft_fabiano
> What about if you declare the field TESTE as CHAR(16)?

The problem persists, with a litte difference (the last digit receive
a #00):

alter table cad1
drop teste;

alter table cad1
add teste char(16) character set octets;

Q.SQL.Text := 'update cad1 set teste = :teste where numcad1 = 0';
Q.ParamByName('teste').AsString :=
#$3D#$09#$AB#$34#$EF#$12#$AB#$4E#$8F#$D4#$56#$A9#$1A#$BF#$90#$1A;
Q.ExecSQL;

SQL> select teste, char_length(teste) from cad1 where numcad1 = 0;
TESTE CHAR_LENGTH
================================ ============
3D09AB34EF12AB4E8FD456A91ABF9000 16

I found a way to workaround this, but it´s not an option for me,
because the SQL instruction in my application is auto-generated by a
third party library. If i change the parameter type to BLOB with a
CAST, it works:

Q.SQL.Text := 'update cad1 set teste = cast(:teste as blob sub_type 1)
where numcad1 = 0';
Q.ParamByName('teste').AsString :=
#$3D#$09#$AB#$34#$EF#$12#$AB#$4E#$8F#$D4#$56#$A9#$1A#$BF#$90#$1A;
Q.ExecSQL;

SQL> select teste, char_length(teste) from cad1 where numcad1 = 0;
TESTE CHAR_LENGTH
================================ ============
3D09AB34EF12AB4E8FD456A91ABF901A 16

I think it is a bug, probably related to the way IBO copy the string
value to a statement parameter.

Can someone confirm this?

Regards,

Fabiano