You are not logged in.
Pages: 1
The JSONToClientDataSet function sets FieldType to sftDateTime for the field Order_ID (must be sftUTF8Text)
JSON
[{"id":69736,"Order_ID":"1435051262-45869-63626","First_Name":"Alex","Last_Name":"Markov","Email":"xxx@xxx.com","program_id":13,"Subscribe_Date":"2015-06-23T09:21:02","subscribed":0}]
The problem is in procedure TSQLTable.InitFieldTypes - the function Iso8601ToTimeLogPUTF8Char returns <> 0 value from input "1435051262-45869-63626"
for i := 1 to fRowCount do
if U^=nil then // search for a non void column
inc(U,FieldCount) else begin
if Iso8601ToTimeLogPUTF8Char(U^,0)<>0 then // U = "1435051262-45869-63626"
FieldType := sftDateTime; // this was a ISO-8601 date/time value
break;
end;
Offline
The safest is to create you own TSQLTableJSON instance, then set the field types as you expect.
But I've fixed the recognition problem.
See http://synopse.info/fossil/info/afa9f26e47
The problem was that ISO-8601 is somewhat versatile, and allows both 'YYYYMMDDThhmmss' and 'YYYY-MM-DD hh:mm:ss' formats, with variations...
Offline
Thanks for the fix. It's working now.
The safest is to create you own TSQLTableJSON instance, then set the field types as you expect..
The problem is that JSON returned from the server by calling:
Res := FProp.ExecuteInlined(SQL, True);
FResult := Res.FetchAllAsJSON;
Ctxt.Returns(FResult);
Offline
Pages: 1