Solved

inserting single quotes in varchar

Posted on 2001-07-06
4
535 Views
Last Modified: 2012-06-27
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


0
Comment
Question by:kapil009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
renuraj earned 50 total points
ID: 6259824
Hi kapil..

Try this out

insert into table1 values( 'test'||''''||'test', 1212,'hai');

Regards,




0
 
LVL 5

Expert Comment

by:ser6398
ID: 6259828
What kind of database?

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;

0
 
LVL 2

Expert Comment

by:renuraj
ID: 6259836
To be clear

insert into table1 values( 'test'||''''||'test', 1212,'hai');

All are single quotes...

Regards,
0
 

Author Comment

by:kapil009
ID: 6259878
Hi ser6398 & renuraj

Thanx

insert into table1 values( 'test'||''''||'test', 1212,'hai');
This statement is working...

I am using DB2...

Bye
Kapil...


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question