Page 1 of 1

SDAC and sql_variant

Posted: Fri 03 Jun 2005 09:26
by ilgiz
When I use field with data type sql_variant I get error:

table.fieldbyname('field').value = error: Unknown type: 14

but
table.fieldbyname('field').AsInteger = 1031.

Posted: Fri 03 Jun 2005 14:14
by Ikar
This message can be raised in Delphi on try to pass incorrectly generated Variant.
Please specify a full code to fill table.fieldbyname('field').value
Could you pass the same value to the local variable of Variant type?

Posted: Tue 07 Jun 2005 07:24
by Guest
CREATE TABLE svariant (
vcode int NULL ,
variant sql_variant NULL
)
GO

insert into svariant
values (1,1030.559)

var v :variant;
begin
msquery1.close;
msquery1.SQL.Text:='select * from svariant';
msquery1.Open;
v:=msquery1.FieldByName('variant').Value;

v - Unknown type: 14
end;

Posted: Tue 07 Jun 2005 12:41
by Ikar
14 corresponds to varDecimal (vt_decimal). Delphi in difference from MS SQL doesn't support this type.