You are not logged in.
Pages: 1
Hi,
I tried both :
1-
dbStmt := dbConn.NewStatementPrepared(sql, True);
dbStmt.ExecutePreparedAndFetchAllAsJson(True, LJson);
2-
LJson := dbConn.Execute(sql,[]).FetchAllAsJson(True);
Both create json with unnecessary array and I can't find option to disable.
{"result": [[{"code": "01","descr": "a"}]]}
Last edited by anouri (2024-12-19 13:21:00)
Offline
A lot to guess, here.
I guess that you are using interface-based services.
I guess that you have a method with a single result/out parameter.
The output is as documented by default: a" result" field with an array of output values, one per parameter.
Since you have a single result parameter, you have an array of an array.
All as expected.
https://synopse.info/files/html/Synopse … #TITLE_470
You can set ResultAsJsonObjectWithoutResult := true at the TServiceFactory level to change the output format.
Offline
Yes it is interface-based service.
Solved.
Thank you so much.
Last edited by anouri (2024-12-21 08:08:50)
Offline
Hi,
when I set ResultAsJsonObjectWithoutResult = true in server side, in client side I got only first record. Json is ok in rest dbugger!
var
I: IAttachmentService;
json: RawJson;
begin
if HttpClient.Services['AttachmentService'].get(I) then
begin
json := I.GetAttachTypeList(); // json contains first record only!
end;
end;
Offline
Thank you. Solved
Offline
Pages: 1