I don't know Progress, but the SQL standard is to duplicate the single quote:
'Customer''s Name'
Question
I am trying to run a simple query over jdbc ALTER TABLE Customer ALTER \"Cust-Name\" set PRO_DESCRIPTION 'Customer Name' This works perfectly well. But, when I have to set description as "Customer's Name", i.e, include a single quote - I am unable to get it to work.
I tried
ALTER TABLE Customer ALTER \"Cust-Name\" set PRO_DESCRIPTION 'Customer~'s Name'
ALTER TABLE Customer ALTER \"Cust-Name\" set PRO_DESCRIPTION 'Customer~~'s Name'
ALTER TABLE Customer ALTER \"Cust-Name\" set PRO_DESCRIPTION 'Customer\\'sName'
ALTER TABLE Customer ALTER \"Cust-Name\" set PRO_DESCRIPTION "Customer's Name"
Nothing works.
Solution
I don't know Progress, but the SQL standard is to duplicate the single quote:
'Customer''s Name'
OTHER TIPS
While I was learning Progress I encountered a function called QUOTER that can be used in your situation.
QUOTER function
Converts the specified data type to CHARACTER and encloses the results in quotes when necessary.
The QUOTER function is intended for use in QUERY-PREPARE where a character predicate must be created from a concatenated list of string variables to form a WHERE clause. In order to process variables, screen values, and input values so that they are suitable for a query WHERE clause, it is often necessary to enclose them in quotes. For example, European-format decimals and character variables must always be enclosed in quotes. You can use the Quoter function to meet that requirement.