Wild Card/Generic retrieval
Deskin, Bob
Bob.Deskin@Cognos.COM
Wed, 10 Sep 2003 13:07:54 -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_01C377BE.13698580
Content-Type: text/plain;
charset="iso-8859-1"
Actually, since the original requirement was to find "th" in the last two
character positions, excluding blanks, a substring would be a direct test as
follows:
SELECT IF "th" = partno[(SIZE(TRUNCATE(partno))-1:2]
Bob
-----Original Message-----
From: John Hunter [mailto:jthunter@nbnet.nb.ca]
Sent: Wednesday, September 10, 2003 12:15 PM
To: powerh-l@lists.swau.edu
Subject: RE: Wild Card/Generic retrieval
Not to be too picky with responses...
but what if the value of partno was '4th6th' ? ie. a value with 2 strings of
th?
then perhaps
> select if 'th' = reverse(reverse(truncate(partno))[1:2])
But I'm not sure if reverse would be more efficient than matchpattern.
-John
-----Original Message-----
If 0 = index(partno,"th") - size(truncate(part-no)) - 1
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_01C377BE.13698580
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<TITLE>RE: Wild Card/Generic retrieval</TITLE>
<META content=3D"MSHTML 5.50.4926.2500" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D549270217-10092003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Actually, since the original requirement was to find "th" in =
the last two=20
character positions, excluding blanks, a substring would be a direct =
test as=20
follows:</FONT></SPAN></DIV>
<DIV><SPAN class=3D549270217-10092003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D549270217-10092003><FONT face=3DArial =
color=3D#0000ff size=3D2>SELECT=20
IF "th" =3D partno[(SIZE(TRUNCATE(partno))-1:2]</FONT></SPAN></DIV>
<DIV><SPAN class=3D549270217-10092003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D549270217-10092003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Bob</FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> John Hunter=20
[mailto:jthunter@nbnet.nb.ca]<BR><B>Sent:</B> Wednesday, September =
10, 2003=20
12:15 PM<BR><B>To:</B> powerh-l@lists.swau.edu<BR><B>Subject:</B> RE: =
Wild=20
Card/Generic retrieval<BR><BR></FONT></DIV>
<DIV><SPAN class=3D240445515-10092003>Not to be too picky with=20
responses...</SPAN></DIV>
<DIV><SPAN class=3D240445515-10092003></SPAN> </DIV>
<DIV><SPAN class=3D240445515-10092003>but what if the value of partno =
was=20
'4th6th' ? ie. a value with 2 strings of th?</SPAN></DIV>
<DIV><SPAN class=3D240445515-10092003></SPAN> </DIV>
<DIV><SPAN class=3D240445515-10092003>then perhaps </SPAN></DIV>
<DIV><SPAN class=3D240445515-10092003></SPAN> </DIV>
<DIV><SPAN class=3D240445515-10092003>> select if 'th' =3D=20
reverse(reverse(truncate(partno))[1:2])</SPAN></DIV>
<DIV><SPAN class=3D240445515-10092003></SPAN> </DIV>
<DIV><SPAN class=3D240445515-10092003>But I'm not sure if reverse =
would be more=20
efficient than matchpattern.</SPAN></DIV>
<DIV><SPAN class=3D240445515-10092003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D240445515-10092003>-John</SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
size=3D2><FONT=20
face=3DTahoma>-----Original Message-----<SPAN =
class=3D240445515-10092003><FONT=20
face=3DArial =
color=3D#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
size=3D2><FONT=20
face=3DTahoma><SPAN =
class=3D240445515-10092003></SPAN></FONT></FONT> </DIV>
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
size=3D2><FONT=20
face=3DTahoma><SPAN =
class=3D240445515-10092003> </SPAN></FONT>If 0 =3D=20
index(partno,"th") - size(truncate(part-no)) - 1</FONT>=20
</DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">Join us at Cognos' biggest event of =
the year<I> Enterprise 2003, The Cognos Business Forum</I>. 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> http://www.cognos.com/enterprise03</U> for more =
details. </FONT></P>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">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.</FONT></P>
------_=_NextPart_001_01C377BE.13698580--