1. Helge Tjelta
  2. as Valentina DB Server
  3. Tuesday, July 31 2018, 08:57 PM
  4.  Subscribe via email
Hey, recently I got a message from a customer, he could not enter the following into my database:

Can't stop falling in love.

Reason the ' killed the input. So how do you guys/girls deal with that character. the '.
Do I change it to ´or ` instead, or what ?
Using sql with my valentina database, input from Standalone web app.

cheers.
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Helge,

There are a few ways:
1) Escape the single quote:
INSERT INTO t1 VALUES ( 'Can\'t stop falling in love' );
2) Repeat the single quote:
INSERT INTO t1 VALUES ( 'Can''t stop falling in love' );
3) Bind a variable
INSERT INTO t1 VALUES ( :1 );
And you can assign the value for the first variable as is without escaping.

Actually, the third way is the best because it also protects against the SQL-injections.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as Valentina DB Server
  3. # 1
Ivan Smahin Accepted Answer
Also, you may call Valentina.EscapeString() method in V4RB to make the input string properly escaped, so your customer will enter the data "as is".
Comment
There are no comments made yet.
  1. more than a month ago
  2. as Valentina DB Server
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories