Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

I need to pass the character ' to my MSSQL database

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

I need to pass the character ' to my MSSQL database

Hello Deon,

Please use JS like that:

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

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

I need to pass the character ' to my MSSQL database

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

I need to pass the character ' to my MSSQL database

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.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

I need to pass the character ' to my MSSQL database

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

I need to pass the character ' to my MSSQL database

Please check another quote symbol ' instead of ' and "

Return to “Issues”