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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Forgot about this. You can use the 'q' syntax as well.
update TBL1
set desc=q'[Clerk's Office]'
where ID='005';
update TBL1
set desc=q'[Clerk's Office]'
where ID='005';