Charlie:

One can always write a program to select the records, of course.  It's
just that there's not a convenient built in SELECT command that seems to
work.

Using an I-type tied to a subroutine will work (I am in Universe):

Write the subroutine FSQ (Find Single Quote):
SUBROUTINE FSQ(RESULT,X)
IF INDEX(X,"'",1) THEN
   RESULT = 1
END ELSE
   RESULT = 0
END
RETURN
END

Compile and catalog this.


Now create an I-type in your CUSTFILE DICT, I will call it NQCNT:
0001: I
0002: SUBR('FSQ',@ID)
0003:
0004:
0005: 2R
0006: S
0007:

Compile the I-type of course.

Then, the command LIST CUSTFILE NAME NQCNT produces:
CUSTFILE    NAME................    NQCNT

6           JOHN'S RESTAURANT           1
2           HOWARD JOHNSONS             0
3           LOU'S BAR                   1
4           STANDARD PLACE              0
5           STARBUCKS                   0

You can see that NQCNT is 1 if there is a single quote in the name, so
you can select those records with the TCL command:
SELECT CUSTFILE WITH NQCNT = 1.

Harold Oaks
Clark County, WA



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Charlie Rubeor
Sent: Friday, October 12, 2007 11:56 AM
To: [email protected]
Subject: RE: [U2] select statement with single quotes

I didn't want to jump the gun and call it a bug, but it certainly looks
like one to me.

This was just the easiest example to document.  If you have a customer
with a name of "Lou's Bar and Grill" the following select statement will
not select it:

SELECT CUSTOMER WITH NAME = "[Lou's]"

I tried all of the suggestions that have been posted, with no luck.  My
current work around is to replace the single quote with the single
character wild card, like this:

SELECT CUSTOMER WITH NAME = "[Lou^s]"

Unfortunately, that also selects any customer with a name of "Louis".



--------------------------------------------------
Charlie Rubeor
Senior Database Administrator
Wiremold/Legrand
60 Woodlawn Street
West Hartford, CT  06110
Tel: 860-233-6251 x3498
Fax: 860-523-3690
Email: [EMAIL PROTECTED]
--------------------------------------------------




"Bill Haskett" <[EMAIL PROTECTED]> Sent by:
[EMAIL PROTECTED]
10/12/2007 01:40 PM
Please respond to
[email protected]


To
<[email protected]>
cc

Subject
RE: [U2] select statement with single quotes






This bug also exists in UniData!  Also, when you get the...

Enter <New line> to continue...

...question at the end of a page of "missing quote:...'..." errors, you 
can't enter
'Q' to quit!  You have to [Ctrl]+C to quit.  I tried in both Pick and 
UniData modes
with no success.  This select statement works fine in D3.  I couldn't 
check jBase or
QM though.

On a side note, it never ceases to amaze me that this anachronistic "end

of page"
comment is still around.  Hasn't it been thirty years since a [New Line]

key existed
on any keyboard?  :-)

Bill

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Jerry Banker
>Sent: Friday, October 12, 2007 8:30 AM
>To: [email protected]
>Subject: RE: [U2] select statement with single quotes
>
>Have you tried using the LIKE option?
>
>SELECT CUSTOMER WITH NAME LIKE "...'..."
>
>
>-----Original Message-----
>From: Charlie Rubeor [mailto:[EMAIL PROTECTED] 
>Sent: Friday, October 12, 2007 10:21 AM
>To: [email protected]
>Subject: [U2] select statement with single quotes
>
>Unidata 6.1, this statement fails.
>
>:SELECT CUSTOMER WITH NAME = "[']"
>missing quote:...'''...
>.
>.
>.
>
>There are no indices on the file and it is not only related to the 
>CUSTOMER file.  Any filename and field will result in the same error 
>message.  For example, 
>
>SELECT VENDOR WITH ADDRESS = "[']"
>
>results in the same message.  Is this a known issue?  More importantly,
>is 
>there an option or setting that I can change to fix it?
>
>--------------------------------------------------
>Charlie Rubeor
>Senior Database Administrator
>Wiremold/Legrand
>60 Woodlawn Street
>West Hartford, CT  06110
>Tel: 860-233-6251 x3498
>Fax: 860-523-3690
>Email: [EMAIL PROTECTED]
>--------------------------------------------------
>-------
>u2-users mailing list
>[email protected]
>To unsubscribe please visit http://listserver.u2ug.org/
>-------
>u2-users mailing list
>[email protected]
>To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to