on ‎2021 Feb 10 12:54 PM
Hi, I'm having difficulty in insertion of a string that contains special characters. Below is my query
INSERT INTO "3D5F24CF599F49B2B3D8FD219665A30B"."TEST_FAQ" VALUES(
'2021-02-10T12:41:01.928Z'/*CREATEDAT <TIMESTAMP>*/,
'admin'/*CREATEDBY <NVARCHAR(255)>*/,
'2021-02-10T12:41:01.928Z'/*MODIFIEDAT <TIMESTAMP>*/,
'admin'/*MODIFIEDBY <NVARCHAR(255)>*/,
'5e3efc3e-6b9d-11eb-9439-0242ac130002'/*ID <NVARCHAR(36)>*/,
'That's my question'/*QUESTION <NVARCHAR(5000)>*/,
<p style='box-shadow: 1px 1px 5px #999999;position: relative;margin: 5px 10px;'><p style='padding: 10px;border: 1px solid transparent;'><p style='font-size:16px;word-wrap: break-word;'>Job Description
</p><p><p><strong>Primary Duties and Responsibilities</strong></p><ul><li>'/*ANSWER <NVARCHAR(5000)>*/
)
It gives me incorrect syntax error. Do I have to change my datatype ? How should I do this ?
Request clarification before answering.
There are two issues in your statement.
1) The opening single quote for the HTML content string is missing.
2) The single quotes in the HTML content string needs to be escaped. A single quote is escape with an additional single quote (' -> '').
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.