 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Facing difficulty in removing the apostrophe in MySQL stored procedure?
To remove apostrophe, replace it. For this, you can use REPLACE(). Following is the syntax −
SET anyVariableName = REPLACE(yourVaribleName , '\'', '');
To understand the above syntax, let us create a stored procedure to remove the apostrophe in MySQL −
mysql> DELIMITER // mysql> CREATE PROCEDURE remove_Apostrophe(IN Value VARCHAR(200))    BEGIN       SET Value = REPLACE(Value , '\'', '');       SELECT CONCAT("AFTER REMOVING APOSTROPHE THE STRING IS= ", Value);    END    // Query OK, 0 rows affected (0.15 sec) mysql> DELIMITER ; Call the stored procedure using CALL command −
mysql> CALL remove_Apostrophe("Introduction to My'SQL"); This will produce the following output −
+----------------------------------------------------------------+ | CONCAT("AFTER REMOVING APOSTROPHE THE STRING IS= ", Value)    | +----------------------------------------------------------------+ | AFTER REMOVING APOSTROPHE THE STRING IS= Introduction to MySQL | +----------------------------------------------------------------+ 1 row in set (0.00 sec) Query OK, 0 rows affected, 1 warning (0.01 sec)Advertisements
 