If you try to insert single quote into DB2 sql table directly, it will give an error message due to single quote is reserved for mark a string value in sql. It is not allowed to use escape sequence for single quote with sql. Below example is incorrect with sql syntax. INSERT INTO CUSTOMERS ( COMPANY_NAME ) VALUES ('Nandun\'s Company') Here middle single quote is not valid even it has used the escape sequence. The easiest method to insert single quote into sql table is replace single quote with double quote. INSERT INTO CUSTOMERS ( COMPANY_NAME ) VALUES ('Nandun\"s Company') In second example I have replaced the single quote with double quote, but once you execute this command it will insert single quote instead of double quote. You can use following code in C#.NET to replace single quote with double quote. Replace("\'", "\"") If you have any question you can list them under comments section.
Here are some original articles, where you can find latest content on Angular, React Native, Java, HTML/CSS, AS400, DB2 and JavaScript. Since its founding in 2009, we’ve grown from an exhaustive source for consumer tech information on latest trends. Want to get more? We are here to help you.