#1 2018-05-05 12:06:07

Horbs
Member
Registered: 2014-04-20
Posts: 23

TSynRestDataset Search Values

Dear All

This is a quick question on using "select by value" statements for the SynRestDataset.CommandText statements.

I've used ...mORMot\SQLite3\Samples\ThirdPartyDemos\EMartin\TSynRestDataset\FishFactSyn for this example.

If I modify
    'http://LocalHost:8080/root/BioLife?select=Species_No, ... ,Notes,Som&sort=Species_No,
by appending
    &where=Species_No=90110'
then the correct result set is returned.

But when I use
    &where=Category=Shark'
in place of the above I get ...

Error Not Found from ... where=Category=Shark.

Is there some special search formating / string literal that I'm missing?

Many thanks

Horbs

Offline

#2 2018-05-05 12:37:05

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

Re: TSynRestDataset Search Values

Use proper URL-encoding, e.g. via the UrlEncode() function, and adding double quotes (") to the string.
Also debug on the TSQLRestServer side (e.g. by enabling verbose logs) to see what is exactly executed.

Offline

#3 2018-05-05 12:58:36

Horbs
Member
Registered: 2014-04-20
Posts: 23

Re: TSynRestDataset Search Values

WOW - cheers AB - double quotes fixed it.

I'll check out the UrlEncode() part.

Huge thanks

Horbs

Offline

Board footer

Powered by FluxBB