INSERT INTO abc VALUES ( 1, 'Write 'C' Program to add two Number' );Fields in relation:
a number; b varchar(30);Problem: While inserting the string in Column b, Oracle Echoes the following message:
'write 'C' program', * ERROR at line 4: ORA-00917: missing commaHow can I insert such a value?
Inserting the single quote can be done in two ways.
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
1) Using extra quotes to insert "C with single quotes around it"
2) To use the function to get the character from its corresponding ASCII value, for single quotes it is 39.
I will provide both examples for you.
1) INSERT INTO abc VALUES ( 1, 'Write "C" Program to add two Number'); 2) INSERT INTO abc VALUES (1, 'Write ' || CHR(39) || 'C' || CHR(39) || ' Program to add two Number');
Dig Deeper on Using Oracle PL-SQL
Related Q&A from Azim Fahmi
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.