ambuli
asked on
SQL handling single and double quotes
Hi there,
I have to insert and delete some data using names that may contain single or double quotes.
INSERT INTO Table (Name,Value) VALUES (' "nameString" ', ' "valueString" ');
DELETE FROM Table WHERE Name= "nameString";
When nameString has a single Quote like, a'mbuli, then I replace the single quote with two single quotes like (a''mbuli) and it works.
But, how can I handle a double quote for example, a"mbuli
Thank you.
I have to insert and delete some data using names that may contain single or double quotes.
INSERT INTO Table (Name,Value) VALUES (' "nameString" ', ' "valueString" ');
DELETE FROM Table WHERE Name= "nameString";
When nameString has a single Quote like, a'mbuli, then I replace the single quote with two single quotes like (a''mbuli) and it works.
But, how can I handle a double quote for example, a"mbuli
Thank you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
if the string value itself contains a single quote, like a'mbuli, you can try:
Open in new window