Hi Adam,
Tried putting quotes, it worked for the following statement without
the % in front of the search term as follows:
var term = 'test';
var sql = "Select * from sampleTable where description like '"+term
+"%'";
but when i put two %, one in front and one behind the term,
QuickConnect doesn't seems to URLEncode the first % properly..
I realised from the log file in QuickConnect framework that when the
sql statement is passed to backend objective C,
the passed in value is as follows:
cmd=getData --> this is correct
msg = .......description%20like%20'%test%25'
The above log file shows that the last %' is encoded properly to %25',
but the first one is just %, i am wondering if we need any escape
character when we pass in '% .
On Nov 26, 11:15 pm, Adam Gedeborg <
adamthestu...@gmail.com> wrote:
> Andrew,
> Well for Situation #1, you set up the SQL Statement wrong. Now I am
> on vacation and have no way to test this, but my gut feeling is that
> you need to have single quotes surrounding your LIKE to make it
> work...as follows:
>
> function searchStuff(...) {
>
> var term = "test";
> var sql = "Select * from sampleTable where description like '%"+term
> +"%'";
> database.getNativeData(sql);
>
> }
>
> After the second % that is a single quote followed by a double quote.
>
> Good luck with that! Hopefully somebody can help with Situation
> #2...I would say adding an element to the query results object like
> queryResults.queryResults2 might work. See if you can get a second
> opinion...
>
> -Adam
> Happy Thanksgiving!
>