When the apostrophe/single quote is at the start of the string, you need to enter 3 single quotes for Oracle to display a quote symbol.
SQL> SELECT '''Hi There' Message FROM dual;
MESSAGE -------------- 'Hi There
In the middle of the string, you need to enter 2 single quotes
SQL> SELECT 'He''s always the first to arrive' Message FROM dual;
MESSAGE ------------------------------- He's always the first to arrive
Single quote is at the end of a string, you need to enter 3 single quotes SQL> SELECT 'Smiths''' FROM dual;
'SMITHS ------- Smiths' If you were to concatenate an apostrophe/single quote in a string, you need to enter 4 single quotes SQL> SELECT 'There' || '''' || 's Henry' Message FROM dual;
-- Here single quate two times after D
I have tested the query.. It is working file
Ajit
Jul 13th, 2011
Here all have given the answer which is for hard coded value for some predefined word. He is asking and I am too looking for the this Question "ANY DATA".If user don't know whether the coming string is having Quotes or not? I had tried with replace but it is not working
Code
span style="color: #ff0000;">" ' "," '' "));
its not working .
Any Good solution?
venki
Jul 23rd, 2011
try this its working insert into tablename (vname)values(chr(39)||'name'||chr(39))
How to insert any data in table which contain single quote ('). Like "Father's Name" By Using SQL.
Profile Answers by globalanil18 Questions by globalanil18
Questions by globalanil18 answers by globalanil18