|
|
Friday, April 29, 2011
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 &.
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 &.
Subscribe to:
Posts (Atom)