Single quotes error in sql

how to enter this statement in sql-INSERT INTO TOTAL_ (STATUS, UPDATED, URGENCY, RESPONSE, CATEGORY, USER, IMPACT, CATEGORY, DATE, AFFECTED_BUSINESS, TOTAL, SUBJECT, FIRST__RESOLUTION, ESCALATED, TIME, AGENT_GROUP, NAME, DUE, ID, LOAD) VALUES (‘Open’,‘06/09/2022 01:14:35’, ‘Low’, ‘06/09/2023 01:14:07’, ‘N/A’, ‘UK’, ‘Low’, ‘N/A’, ‘06/09/2022 01:14:34’, ‘Metal Forming’, ‘N/A’, ‘Issue on TW regarding IHK ‘afafzeugnisse’ können i nicht gedruckt .’, ‘False’, ‘True’, ‘1d 3h 3m 40s’, ‘HGMF - IT Site Support’, ‘Markus Huber’, ‘06/21/2023 08:11:35’, ‘140846’, ‘06/27/2022 12:53:04’).IT SHOWS COMMA MISSING ERROR

Hi @Cuberoot ,

Could you let us know what was tried in Studio ? Also, was a verification for the Query done in the SQL Server/Studio itself ?

@Cuberoot

To escape single quote use double single quotes ' to ''(two single quotes)

use a replace function

cheers

I have tried the above query in SQL developer and it shows error-comma is missing

@Cuberoot

Could you please take a look at the modified query here, as you need to double up the single quotes within the text value ‘Issue on TW regarding IHK ‘‘afafzeugnisse’’ können i nicht gedruckt .’ to escape them properly.

INSERT INTO TOTAL_ (STATUS, UPDATED, URGENCY, RESPONSE, CATEGORY, [USER], IMPACT, [CATEGORY], [DATE], AFFECTED_BUSINESS, [TOTAL], SUBJECT, FIRST__RESOLUTION, ESCALATED, [TIME], AGENT_GROUP, [NAME], [DUE], [ID], [LOAD])
VALUES ('Open','06/09/2022 01:14:35', 'Low', '06/09/2023 01:14:07', 'N/A', 'UK', 'Low', 'N/A', '06/09/2022 01:14:34', 'Metal Forming', 'N/A', 'Issue on TW regarding IHK ''afafzeugnisse'' können i nicht gedruckt .', 'False', 'True', '1d 3h 3m 40s', 'HGMF - IT Site Support', 'Markus Huber', '06/21/2023 08:11:35', '140846', '06/27/2022 12:53:04')

Hope this helps,
Best Regards.

all these are varchar datatypes

@Cuberoot

Well, in that case, the varchar data type does not require single quotes for values. The error you encountered is likely due to a different issue.

Please proceed with the clarifications requested by @supermanPunch above.

Best Regards.

it works. Thanks for the solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.