Thursday, April 28, 2011

Inserting data values in to database which having '&' in it.

Hi guys,

If u have an insert sql command like this

Insert into rushi_details(first_name,Last_name,emp_id,company_name) values('rushendra','prasad',1234,'rushi consulting & outsorcing')

This will not insert and prompt to enter a valuse for outsorcing as we have '&' before it. for this type of issues used this command:

set ESCAPE \
Insert into rushi_details(first_name,Last_name,emp_id,company_name) values('rushendra','prasad',1234,'rushi consulting \& outsorcing')

Then this will insert in to rushi_details table

If we inserting one or more than one keep the set ESCAPE \ before al insert statements then run.

NOTE: 'rushi consulting \& outsorcing' we are keeping \ before &.

3 comments:

  1. Well, it’s a nice one, I have been looking for. Thanks for sharing such informative stuff.

    ----------------------------
    Best website design and development Company In Kanpur

    ReplyDelete
  2. Come and enjoy the beauty of Pari island with its white sandy beaches and clear water sheen, one of the best tourist attractions.

    -------------------
    Home Relocation Services in Pune

    ReplyDelete