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.
Oracle DatabaseSQL

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
David VanZandt

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.
slightwv (䄆 Netminder)

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

update TBL1
  set desc=q'[Clerk's Office]'
  where ID='005';
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy