Wednesday, March 16, 2011

Single quotation in SQL insert statment

If you want to insert a value into the row and this value contains some sigle quotation, for exmaple the attribute value that need to be inserted may be like 'Z542.UAT.IN.CMBIZ'.

You can achieve this by using double single quotation in your insert statement which is shown as the below:

INSERT INTO ATTRIBUTES (ATTRIBUTE_ID, ATTRIBUTE_NAME, ATTRIBUTE_VALUE) VALUES('AccessTargetDir','AccessTargetDir','''Z542.UAT.IN.CMBIZ''');

No comments:

Post a Comment