You are not logged in.
Pages: 1
That works Great! Thank you very much ab.
Hi Everyone
I have some issue about JSON data returned from mORMot Service.
I have created a service with mORMot (TCarService.GetData) and
the service is called from Browser Client (AngularJS).
Below is service code
function TCarService.GetData(aSqlText: RawUTF8): RawUTF8;
var
Props : TSQLDBConnectionProperties;
res : ISQLDBRows;
begin
Props := TOleDBMSSQL2012ConnectionProperties.Create('127.0.0.1', 'Car_DB', 'sa', 'password');
try
res := Props.ExecuteInlined(aSqlText, True);
result := res.FetchAllAsJSON(True);
finally
Props.Free;
end;
end;
but the returned JSON result looks like this
{"result":["[
{\"MakeCode\":\"ALFA\"},
{\"MakeCode\":\"ASTO\"},
{\"MakeCode\":\"AUDI\"},
{\"MakeCode\":\"BENT\"},
{\"MakeCode\":\"BMW \"},
{\"MakeCode\":\"CHER\"},
{\"MakeCode\":\"TOYO\"},
{\"MakeCode\":\"VOLK\"},
{\"MakeCode\":\"VOLV\"}
]\n"]}
Is there ways to return as True JSON data not string (with FetchAllAsJSON(True)) ?
or I must remove '"', '\' , '\n' at Client Side.
expected Result like this
{"result":
[
{"MakeCode":"ALFA"},
{"MakeCode":"ASTO"},
{"MakeCode":"AUDI"},
{"MakeCode":"BENT"},
{"MakeCode":"BMW"},
{"MakeCode":"CHER"},
{"MakeCode":"TOYO"},
{"MakeCode":"VOLK"},
{"MakeCode":"VOLV"}
]}
Thank you very much
Thank you so much ab. I will try each way above.
Hi Everyone,
I am new to mORMot framework and I have a question about it.
Does mORMot have any feature like Reconcile Error Event (Delphi 's DataSnap)?
Ex.
1) User A and User B retrieve the same record
2) User A edits and saves the record
3) User B edits and saves the record after User A commits transaction
4) User B gets an error message 'Record changed by another user' and Rollback Transaction.
I found mORMot framework is so amazing and I really want to move from DataSnap to mORMot but my boss still loves DataSnap cause it only has Reconcile Error feature!)
Thank you very much,
Chowong
Pages: 1