You are not logged in.
I'm new to mORMot and trying to learn.
In this case I have a problem finding the oldest record (birthDate) in table Baby.
I reused the example from the documentation to test ORM.
What I want to do is execute the following SQL-code
BirthDate = (SELECT MIN(BirthDate) FROM Baby)
This is how I solved it:
Baby.Free;
Baby := TSQLBaby.CreateAndFillPrepare( aClient, 'BirthDate = (SELECT MIN(BirthDate) FROM Baby)',[]);
while Baby.FillOne do
begin
Memo1.lines.Add(Format('%s - %s ',[Baby.Name, Baby.Address]));
end;
As you can see I have the "Bounds"-parameter empty[] because I couldn't make it work so I had to put the complete SQL in the "FormatSQLWhere"-parameter.
Is there any other aproach that you recommend to be used?
That made it!
Thanks a lot, both of you.
Now I can get rid of the Indy components that require a lot of bugfixes, I had to do myself, to make https work.
Thanks again.
I've been very busy this week will still be for a while. After all, I tried to test your suggestion, but I can't make it work. I have no idea how to use this.
I tried this but it won't do a thing.
cl := TWinHttp.Create('localhost', '4430', false);
authResponse := cl.Post('localhost/authenticate/',AuthData,'Key: Content-Type, Value: application/json',true,HDRResponse);
I tried to begin without using https and also on a localhost server to minimize error sources.
I debugged the code and it seems that cl.post won't care about what I did in create.
Any idea of what I missing?
We want to create an application calling an existing web service with https.
The first service call will be authentication, parameters are username and password.
On success, we will get a token that is saved to be used in future calls of other service functions.
Responses will be in JSON.
I'm new to mORMot and not yet especially familiar with all functions and need some help finding the key functions.
I've been searching for a while but not found any that sound's to fit in. I'm sure there is but would be grateful to any help.
Looked at the sample code of "Project06ClientMain" and found "Client := TSQLRestClientURINamedPipe.Create(Model,'RestService');". But this uses NamedPipes and I need https.
Also, it uses "model" and wonder if it necessary to create a TSQLRecord here or if there is possible to pick the items from JSON directly here?
I've made it work already with some Delphi components but are very interested in mORMot and want to use it as much as possible.