[Info-ingres] E_RW101A with single quotes

Emma McGrattan Emma.McGrattan at actian.com
Fri Mar 23 20:15:32 UTC 2018


There’s a very similar example in the documentation. http://docs.actian.com/ingres/11.0/index.html#page/CharQueryRepUser%2FPassing_String_Values_with_Embedded_Quotes.htm
Hope it helps

Passing String Values with Embedded Quotes
Suppose the database value for which you are entering a comparison value contains embedded single or double quotes, as for example:
"Big John's" Barbecue
Suppose the where clause is specified in the report as:
where $wherevar
You want to specify a value for the variable so that Report‑Writer produces the following SQL query:
where clientname='"Big John''s" Barbecue'
Follow this procedure:
1. Determine how the value appears in the database:
"Big John's" Barbecue
2. Enclose the string value in quotes that are appropriate for your query language (single quotes in SQL). Dereference any embedded quotes (including apostrophes) according to the rules of your query language (in SQL, precede a single quote or apostrophe with another single quote):
'"Big John''s" Barbecue'
3. Enclose the entire valuestring within single quotes to identify it to Report‑Writer as a string. Dereference any embedded single quotes within this string by preceding each single quote with another single quote. This includes any single quotes (or apostrophes) from the original value, as well as those required by your query language in the previous step.
'clientname=''"Big John''''s" Barbecue'''
4. Enclose the entire parameter within parentheses. If the parameter contains any characters treated specially by your operating system (such as parentheses in Windows NT and UNIX or slashes in VMS), enclose the entire parameter within double quotes and escape any embedded double quotes to pass them through the operating system.
Windows:
report accounting receivables "(wherevar=
'clientname=''\"Big John''''s\" Barbecue"''')"
UNIX:
report accounting receivables "(wherevar=
'clientname=''\"Big John''''s\" Barbecue"''')"
VMS:
report accounting receivables "(wherevar=
'clientname=''""Big John''''s"" Barbecue"''')"
Note for QUEL Users
To specify a value for the variable so that Report‑Writer produces the following QUEL query:
where clientname="\"Big John's\" Barbeque"
Follow this procedure:
1. Determine how the value appears in the database:
"Big John's" Barbeque
2. Enclose the string value in quotes that are appropriate for your query language (double quotes in QUEL). Dereference any embedded quotes according to the rules of your query language (in QUEL, precede a double quote with a backslash):
"\"Big John's\" Barbeque"
3. Enclose the entire valuestring within single quotes to identify it to Report‑Writer as a string. Dereference any embedded single quotes (or apostrophes) within this string by preceding each one with a single quote.
'clientname="\"Big John''s\" Barbeque"'
4. Enclose the entire parameter within parentheses. If the parameter contains any characters treated specially by your operating system (such as parentheses in Windows NT and UNIX or slashes in VMS), enclose the entire parameter within double quotes and escape any embedded double quotes to pass them through the operating system.
Windows:
report accounting receivables "(wherevar= 'clientname=\"\\\"Big John''s\\\"Barbeque\"')"
UNIX:
report accounting receivables "(wherevar= 'clientname=\"\\\"Big John''s\\\"Barbeque\"')"
VMS:
report accounting receivables "(wherevar= 'clientname=""\""Big John''s\""Barbeque""')"

Copyright 2018 Actian Corporation. All rights reserved.



From: info-ingres-bounces at lists.planetingres.org <info-ingres-bounces at lists.planetingres.org> On Behalf Of armand pirvu
Sent: Friday, March 23, 2018 4:05 PM
To: info-ingres at lists.planetingres.org
Subject: [Info-ingres] E_RW101A with single quotes

report scbs18 "(p_qualification='1=1', p_evt_uid=969, p_evt_id='SCBS18', p_dollar_sign='$', p_centered_org_name=' COMPUSYSTEMSINC.',p_rw_head_1_desc='Suncoast Boat Show', p_rw_head_2_desc='April 19 - 22, 2018', p_rw_head_3_desc='Marina Jack's', p_rw_head_4_desc='Sarasota, Florida',p_rw_head_5_desc='', p_userid='armandp')" -i/u1/irs/rpt/rsw0425.rw -v60

E_RW1001 Bad parameters specified at or near '',
p_rw_head_4_desc='Sarasota, Florida',p_rw_head_5_desc='', p_userid='armandp')'
Correct usage of REPORT command is:

In /u1/ingres/files/utexe.def report section
param "(%S)"


Once I take out the single quote from Marina Jack's I am okay

So is this expected ? A bug ? A work around ?


Thks
_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org<mailto:Info-ingres at lists.planetingres.org>
http://lists.planetingres.org/mailman/listinfo/info-ingres<http://lists.planetingres.org/mailman/listinfo/info-ingres>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20180323/d97d34c8/attachment.html>


More information about the Info-ingres mailing list