Wild Card/Generic retrieval

Deskin, Bob Bob.Deskin@Cognos.COM
Tue, 9 Sep 2003 13:32:35 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C376F8.5B6D69D0
Content-Type: text/plain

The section you were reading refers to pattern matching as opposed to
generic or partial key retrieval. When you use a CHOOSE, you are providing a
key or partial-key value. You can't use a PowerHouse pattern in a CHOOSE.
The @ in this case indicates a partial key retrieval for indexed files (or
relational). So "Mac@" returns all values starting with "Mac".

In order to retrieve all values ending with "th", you would have to read
each record sequentially and check the value. To do that, use a SELECT with
the MATCHPATTERN function as in:

SELECT IF MATCHPATTERN(TRUNCATE(partno),"@th")

The TRUNCATE removes trailing spaces, otherwise you'd have to match them.

Bob Deskin              
Product Manager, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) 727-1178
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA

-----Original Message-----
From: Landers, Dianne [mailto:DLanders@pcc-structurals.com]
Sent: Tuesday, September 09, 2003 1:12 PM
To: powerh-l@lists.swau.edu
Subject: Wild Card/Generic retrieval


Running Unix 11.0, oracle 8.1.7, ph 8.23d7.
In the manual Powerhouse Rules, the section on using metacharacters, for
the generic character at sign(@), the function description:

Matches zero or more characters (alphabetic, numeric, or special).
Gives the example that I'm trying to use.....
The pattern "@th" matches any value ending with "th".

I'm trying to retrieve records by the following:
> Access partmaster
> Choose partno '@03'
> Rep partno
> Go
 
There is a partno in the database P03, that should be reported.  But I
get zero records found. 
I tried this code, and get an error message:

> access partmaster
> choose partno "@"
                ^^^
*E* The generic choose character is not allowed without a prefix.
> 

So is the manual wrong?  I'm I interpreting the manual wrong?  I'm
confused.


= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

Join us at Cognos' biggest event of the year Enterprise 2003, The Cognos
Business Forum.  Taking place in over 25 cities around the world, it's an
opportunity for Business and IT leaders to learn about strategies for
driving performance. Visit http://www.cognos.com/enterprise03 for more
details. 

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

------_=_NextPart_001_01C376F8.5B6D69D0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>RE: Wild Card/Generic retrieval</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>The section you were reading refers to pattern =
matching as opposed to generic or partial key retrieval. When you use a =
CHOOSE, you are providing a key or partial-key value. You can't use a =
PowerHouse pattern in a CHOOSE. The @ in this case indicates a partial =
key retrieval for indexed files (or relational). So &quot;Mac@&quot; =
returns all values starting with &quot;Mac&quot;.</FONT></P>

<P><FONT SIZE=3D2>In order to retrieve all values ending with =
&quot;th&quot;, you would have to read each record sequentially and =
check the value. To do that, use a SELECT with the MATCHPATTERN =
function as in:</FONT></P>

<P><FONT SIZE=3D2>SELECT IF =
MATCHPATTERN(TRUNCATE(partno),&quot;@th&quot;)</FONT>
</P>

<P><FONT SIZE=3D2>The TRUNCATE removes trailing spaces, otherwise you'd =
have to match them.</FONT>
</P>

<P><FONT SIZE=3D2>Bob =
Deskin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>Product Manager, Application Development Tools, =
Cognos Inc.</FONT>
<BR><FONT SIZE=3D2>bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: =
(613) 727-1178</FONT>
<BR><FONT SIZE=3D2>3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON =
K1G 4K9 CANADA</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Landers, Dianne [<A =
HREF=3D"mailto:DLanders@pcc-structurals.com">mailto:DLanders@pcc-structu=
rals.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, September 09, 2003 1:12 PM</FONT>
<BR><FONT SIZE=3D2>To: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subject: Wild Card/Generic retrieval</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Running Unix 11.0, oracle 8.1.7, ph 8.23d7.</FONT>
<BR><FONT SIZE=3D2>In the manual Powerhouse Rules, the section on using =
metacharacters, for</FONT>
<BR><FONT SIZE=3D2>the generic character at sign(@), the function =
description:</FONT>
</P>

<P><FONT SIZE=3D2>Matches zero or more characters (alphabetic, numeric, =
or special).</FONT>
<BR><FONT SIZE=3D2>Gives the example that I'm trying to use.....</FONT>
<BR><FONT SIZE=3D2>The pattern &quot;@th&quot; matches any value ending =
with &quot;th&quot;.</FONT>
</P>

<P><FONT SIZE=3D2>I'm trying to retrieve records by the =
following:</FONT>
<BR><FONT SIZE=3D2>&gt; Access partmaster</FONT>
<BR><FONT SIZE=3D2>&gt; Choose partno '@03'</FONT>
<BR><FONT SIZE=3D2>&gt; Rep partno</FONT>
<BR><FONT SIZE=3D2>&gt; Go</FONT>
<BR><FONT SIZE=3D2>&nbsp;</FONT>
<BR><FONT SIZE=3D2>There is a partno in the database P03, that should =
be reported.&nbsp; But I</FONT>
<BR><FONT SIZE=3D2>get zero records found. </FONT>
<BR><FONT SIZE=3D2>I tried this code, and get an error message:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; access partmaster</FONT>
<BR><FONT SIZE=3D2>&gt; choose partno &quot;@&quot;</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^</FONT>
<BR><FONT SIZE=3D2>*E* The generic choose character is not allowed =
without a prefix.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

<P><FONT SIZE=3D2>So is the manual wrong?&nbsp; I'm I interpreting the =
manual wrong?&nbsp; I'm</FONT>
<BR><FONT SIZE=3D2>confused.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =
=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D</FONT>
<BR><FONT SIZE=3D2>Mailing list: powerh-l@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Subscribe: &quot;subscribe&quot; in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2>Unsubscribe: &quot;unsubscribe =
&lt;password&gt;&quot; in message body to =
powerh-l-request@lists.swau.edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.swau.edu/mailman/listinfo/powerh-l" =
TARGET=3D"_blank">http://lists.swau.edu/mailman/listinfo/powerh-l</A></F=
ONT>
<BR><FONT SIZE=3D2>This list is closed, thus to post to the list you =
must be a subscriber.</FONT>
</P>

<P><FONT SIZE=3D2>Join us at Cognos' biggest event of the year<I> =
Enterprise 2003, The Cognos Business Forum</I>.&nbsp; Taking place in =
over 25 cities around the world, it's an opportunity for Business and =
IT leaders to learn about strategies for driving performance. Visit<U> =
<A HREF=3D"http://www.cognos.com/enterprise03" =
TARGET=3D"_blank">http://www.cognos.com/enterprise03</A></U> for more =
details. </FONT></P>

<P><FONT SIZE=3D2>This message may contain privileged and/or =
confidential information.&nbsp; If you have received this e-mail in =
error or are not the intended recipient, you may not use, copy, =
disseminate or distribute it; do not open any attachments, delete it =
immediately from your system and notify the sender promptly by e-mail =
that you have done so.&nbsp; Thank you.</FONT></P>

</BODY>
</HTML>
------_=_NextPart_001_01C376F8.5B6D69D0--