#1 2013-07-08 12:50:39

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Strange behaviour of JSONToDataSet

When JSON looks like:


{"fieldCount":2,"values":["email","licNum","x1@macau.ctm.net",01,"x2@gte.net",01,"x3@active8.nl",01,"x4@unetek.com",01,"x5@home.com",01,"x6@harvard.edu",01,"x7@eds.com",01,"x8@optonline.net",01,"x9@maties.sun.ac.za",01,"x10@pateam.com",01],"rowCount":10}

The JSONToDataSet parses only first row and the other rows of FDataSet  is empty

FDataSet := JSONToDataSet(self, FRawResult);

Screenshot:

http://i.imgur.com/T0TzRtc.png

Offline

#2 2013-07-08 13:07:02

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: Strange behaviour of JSONToDataSet

With the last source (edf68f6b07 ) all work fine.

Offline

#3 2013-07-08 14:23:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Strange behaviour of JSONToDataSet

Note that AFAIK   01  is an invalid JSON number.
See http://json.org

Offline

#4 2013-07-09 06:25:52

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: Strange behaviour of JSONToDataSet

I agree, but JSON was generated by function ISQLDBRows.FetchAllAsJSON

var
  res       : ISQLDBRows;
  Result : RawUtf8;
  FProp     : TSQLDBFireDACConnectionProperties;
begin
...
   Res := FProp.ExecuteInlined(SQL, True);

   if res = nil then
    Result := ''
   else
     Result := res.FetchAllAsJSON(False);
end;

Offline

#5 2013-07-09 07:07:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Strange behaviour of JSONToDataSet

Yes, there was an issue about internal BCD fast conversion into text, which has just been fixed.

It is always a good idea to use the latest unstable version!
smile

Offline

Board footer

Powered by FluxBB