You are not logged in.
Pages: 1
One more question, how I can find all rows with some "enum" property if I have "set" field in database?
For example:
TTest = (tOne, tTwo, tThree, tFour, tFive);
TTestSet = Set of TTest;
T_Test = class(TSQLRecord)
private
...
fTestSet: TTestSet;
published
...
property TestSet: TTestSet read fTestSet write fTestSet;
end;
procedure Smth(aTest: TTest);
var
lJSON: TSQLTableJSON;
begin
lJSON := Client.List([T_Test], 'T_Test.ID', 'T_Test.TestSet LIKE "' + aTest + '"'); // what should I write in SQLWhere?
end;
Or I need to delete "wrong" rows after I get lJSON ?
It's working! I'm so stupid)) Thanks a lot!
I tried to do like you say before start topic, but there was "Invalid typecast" errors in TSetInvType(lInvInteger) and Integer(lInvType).
Thanks, I think my function is satisfy me.
Yes, I know. But I think you have a function for "Integer->Set" transformation in framework.
Something like that, but universal
function IntegerToSetInvType(I: Integer): TSetInvType;
var
Index: Integer;
begin
Result := [];
Index := 0;
while (I <> 0) do
begin
if ((Byte(I) and 1) = 1) then
Result := Result + [TInvType(Index)];
Inc(Index);
I := I shr 1;
end;
end;
var
lInvType: TSetInvType;
begin
...
lInvType := IntegerToSetInvType(aJSONTable.GetAsInteger(I, FieldIndex));
Hello, I have some variable of set type (TSetInv = Set of TInv) in my base, and I can't get this variable from TSQLTableJSON field, can you help me?
Pages: 1