Link to home
Start Free TrialLog in
Avatar of mrong
mrong

asked on

Single quote in Oracle update stmt

Greeting,

I have the following update query in Oracle. The single quote inside the update stmt(Clerk's) caused error. Any suggestions?

update TBL1
set desc='Clerk's Office'
where ID='005';

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
IOW the extra apostrophe is required to prevent literal strings from being mistaken as a field delimiter.  Oracle allows the delimiter (quote) to become some other character, but that's a pain.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Forgot about this.  You can use the 'q' syntax as well.

update TBL1
  set desc=q'[Clerk's Office]'
  where ID='005';