Page 1 of 1

I need to pass the character ' to my MSSQL database

Posted: Sat Oct 10, 2015 11:17 am
by Deon

Hi

I have a query with the following parameters.

return('Username='+value+'');

That works fine if the value is a number but not a string. The string value needs to between single quotes when I pass it to my database.

How do add a single quote to the above query parameter to indicate that the value is of type string?

It would be great if I could do something like this..
return('Username=''+value+'''); but of course that does not work


I need to pass the character ' to my MSSQL database

Posted: Sat Oct 10, 2015 3:24 pm
by Serhii Kulibaba

Hello Deon,

Please use JS like that:

prereturn "Username='" + value + "'";/pre


I need to pass the character ' to my MSSQL database

Posted: Sun Oct 11, 2015 6:16 am
by Deon

Hi Sergiy

That only works with MangoDB. Does not work with MS or MySQL. Unfortunately the " is encoded and passed through. I need to literally pass the ' but ' are not permitted in the syntax by the looks of it.

return('Username='+value+''); does work with MySQL though but not MSSQL.

I have created a workaround where I embrace the username in single quotes in a variable first.

So now I have 'username' instead of username.

It works fine but this is not ideal as it causes extra processing time. I need to pass a single quote. I also see spaces are encoded as + and not as %20. This is also a problem with MSSQL as it does not interpret + as a space.

Thank you


I need to pass the character ' to my MSSQL database

Posted: Sun Oct 11, 2015 6:15 pm
by Serhii Kulibaba

Please check escape characters for quotes. It could be helpful.
I am very sorry, but this is something outside the scope (http://devcenter.appery.io/support-po...) of our support.


I need to pass the character ' to my MSSQL database

Posted: Mon Oct 12, 2015 6:09 pm
by Deon

Hi Sergiy
Escape characters get encoded as well \' = %27

It seems the issue is with the MSSQL interperatation. It does not seem to decode %27 whereas MySQl does.


I need to pass the character ' to my MSSQL database

Posted: Thu Oct 22, 2015 8:42 pm
by Serhii Kulibaba

Please check another quote symbol ' instead of ' and "