kapil009
asked on
inserting single quotes in varchar
Hi friends.
How to insert the a Single Quotes (') in a varchar data field.
If i give query like as following
insert into table1 values( 'test'test' , 1212,'hai');
There are 3 fields fl1,fl2 fl3.
fl1 value = "test'test"
but i dont how to insert this value
Any one can help me?
waiting for reply
Kapil
How to insert the a Single Quotes (') in a varchar data field.
If i give query like as following
insert into table1 values( 'test'test' , 1212,'hai');
There are 3 fields fl1,fl2 fl3.
fl1 value = "test'test"
but i dont how to insert this value
Any one can help me?
waiting for reply
Kapil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To be clear
insert into table1 values( 'test'||''''||'test', 1212,'hai');
All are single quotes...
Regards,
insert into table1 values( 'test'||''''||'test', 1212,'hai');
All are single quotes...
Regards,
ASKER
Hi ser6398 & renuraj
Thanx
insert into table1 values( 'test'||''''||'test', 1212,'hai');
This statement is working...
I am using DB2...
Bye
Kapil...
Thanx
insert into table1 values( 'test'||''''||'test', 1212,'hai');
This statement is working...
I am using DB2...
Bye
Kapil...
One possible way is to use the ASCII function of whatever database you are using. In Oracle, you could do something like:
select chr(39)||'bob'||chr(39)
from dual;
You get the same result as:
select '''bob'''
from dual;