Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Find a "%" character in a find using like clause

5 posts in DataWindow Last posting was on 2008-10-07 17:51:59.0Z
Joseph Posted on 2008-10-06 17:45:09.0Z
From: Joseph <niroc134@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Find a "%" character in a find using like clause
Date: Mon, 6 Oct 2008 10:45:09 -0700 (PDT)
Organization: http://groups.google.com
Lines: 18
Message-ID: <3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com>
NNTP-Posting-Host: 198.45.18.69
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1223315110 6244 127.0.0.1 (6 Oct 2008 17:45:10 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 6 Oct 2008 17:45:10 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v28g2000hsv.googlegroups.com; posting-host=198.45.18.69; posting-account=-lwUqgoAAAD7laJevYTehVa6NoiJHf_v
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!v28g2000hsv.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87929
Article PK: 417184

I need to find a character of % in a datawindow find function. The
find is built using a like clause and always appends a % at the end of
the string. Any suggestions? Thx

Example 1

string ls_value = "ABC" + "%"
dw_1.find ("code like" + ls_value,1,dw_1.rowcount())

record is found for code value of "ABCD"


Example 1
string ls_value = "A%BC" + "%"
dw_1.find ("code like" + ls_value,1,dw_1.rowcount())

record is NOT found for code value of "A%BCD"


Ken Balakrishnan Posted on 2008-10-06 20:40:18.0Z
From: "Ken Balakrishnan" <kNOeSPAMn@cpsREMOVEME92.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com>
Subject: Re: Find a "%" character in a find using like clause
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ea77b2$1@forums-1-dub>
Date: 6 Oct 2008 13:40:18 -0700
X-Trace: forums-1-dub 1223325618 10.22.241.152 (6 Oct 2008 13:40:18 -0700)
X-Original-Trace: 6 Oct 2008 13:40:18 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87932
Article PK: 417192

I'm not sure I totally understand your question, but it sounds like you
might find what you need if you look up the help for "LIKE Operator" (which
will bring up the topic "Relational operators in DataWindow expressions")
and scroll down to the "Escape keyword" section.

HTH,
Ken

"Joseph" <niroc134@gmail.com> wrote in message
news:3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com...
>I need to find a character of % in a datawindow find function. The
> find is built using a like clause and always appends a % at the end of
> the string. Any suggestions? Thx
>
> Example 1
>
> string ls_value = "ABC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is found for code value of "ABCD"
>
>
> Example 1
> string ls_value = "A%BC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is NOT found for code value of "A%BCD"
>


Jeremy Lakeman Posted on 2008-10-06 22:38:27.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Find a "%" character in a find using like clause
Date: Mon, 6 Oct 2008 15:38:27 -0700 (PDT)
Organization: http://groups.google.com
Lines: 34
Message-ID: <675da0d9-1adc-4b58-a98e-46cfb9d22e46@v28g2000hsv.googlegroups.com>
References: <3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com> <48ea77b2$1@forums-1-dub>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1223332708 30498 127.0.0.1 (6 Oct 2008 22:38:28 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 6 Oct 2008 22:38:28 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v28g2000hsv.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!v28g2000hsv.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87934
Article PK: 417189

On Oct 7, 6:40 am, "Ken Balakrishnan" <kNOeSP...@cpsREMOVEME92.com>

wrote:
> I'm not sure I totally understand your question, but it sounds like you
> might find what you need if you look up the help for "LIKE Operator" (which
> will bring up the topic "Relational operators in DataWindow expressions")
> and scroll down to the "Escape keyword" section.
>
> HTH,
> Ken
>
> "Joseph" <niroc...@gmail.com> wrote in message
>
> news:3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com...
>
> >I need to find a character of % in a datawindow find function.  The
> > find is built using a like clause and always appends a % at the end of
> > the string.  Any suggestions?  Thx
>
> > Example 1
>
> > string ls_value = "ABC" + "%"
> > dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> > record is found for code value of  "ABCD"
>
> > Example 1
> > string ls_value = "A%BC" + "%"
> > dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> > record is NOT found for code value of "A%BCD"

Or just use the pos function instead.
dw_1.find ("pos(code, '"+ls_value+"')>0",1,dw_1.rowcount())


Joseph Posted on 2008-10-07 14:15:54.0Z
From: Joseph <niroc134@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Find a "%" character in a find using like clause
Date: Tue, 7 Oct 2008 07:15:54 -0700 (PDT)
Organization: http://groups.google.com
Lines: 50
Message-ID: <0e969c1e-b1a3-4398-baf3-7c58af74cbec@s50g2000hsb.googlegroups.com>
References: <3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com>
NNTP-Posting-Host: 198.45.18.69
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1223388954 20336 127.0.0.1 (7 Oct 2008 14:15:54 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 7 Oct 2008 14:15:54 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: s50g2000hsb.googlegroups.com; posting-host=198.45.18.69; posting-account=-lwUqgoAAAD7laJevYTehVa6NoiJHf_v
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!news-out.readnews.com!transit4.readnews.com!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87940
Article PK: 417196


On Oct 6, 11:45 am, Joseph <niroc...@gmail.com> wrote:
> I need to find a character of % in a datawindow find function.  The
> find is built using a like clause and always appends a % at the end of
> the string.  Any suggestions?  Thx
>
> Example 1
>
> string ls_value = "ABC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is found for code value of  "ABCD"
>
> Example 1
> string ls_value = "A%BC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is NOT found for code value of "A%BCD"

It looks like there are a limited number of options on how to search
for the value "%" in the FIND datawindow method. (I was hoping for a
special character match routine)
Looking for a solution to this issue about finding a ‘%’ value in a
string in the Find operation:

As you know, the % is a wildcard used for searching patterns within a
string. But what happens if you need to find an actual value of ‘%’
within the string? PowerBuilder Find function(s) works similar to the
of LIKE operator in ansi SQL. Unfortunately, there is no way in
PowerBuilder to use the operator LIKE and a value of ‘%” and a
wildcard all in the same search criteria. In order to look for the
actual value of a character of ‘%”, we need to forgo the LIKE
operator. This leaves with two options:

- USE operator, “=”. The “=” operator acts like an exact match
search. This means in order to find a string like “% - OTHOC”, the
user must type in the Find value field “% - OTHOC” in order to find
the record.
– Second option is to change the LIKE operator to a pattern matching
routine. Pattern matching works similar of having a default wildcard
ALWAYS in the beginning and at the end of the find value. However,
you cannot use the “%” value in a middle of a search and have
searching work as a wildcard. Example: searching for a value of “OT”,
it will find records like “% - OTHOC”, “OTCBNH”, “HGROTVG”, and
“HHHGOT”. Example2: searching for a value of “%”, will find records
like “%- OTHOC”, “OOO%LLL”, and “UIJ%”.

Unless there is a special character matching, I don't see any other
alternative.


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-07 17:51:59.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <3441e6a2-2de7-4b67-a63a-232c359ff8f9@v28g2000hsv.googlegroups.com> <0e969c1e-b1a3-4398-baf3-7c58af74cbec@s50g2000hsb.googlegroups.com>
Subject: Re: Find a "%" character in a find using like clause
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48eba1bf$2@forums-1-dub>
Date: 7 Oct 2008 10:51:59 -0700
X-Trace: forums-1-dub 1223401919 10.22.241.152 (7 Oct 2008 10:51:59 -0700)
X-Original-Trace: 7 Oct 2008 10:51:59 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87942
Article PK: 417198

Sure there is. As Ken suggested, use the escape argument. When you want % to
be a wildcard, do not use the escape character you have declared. When you
want to search for "%" put the escape character in front of it.
Example: you want to search for "100%" followed by anything
my_column like ~'100|%% escape ~'|~'

"Joseph" <niroc134@gmail.com> wrote in message
news:0e969c1e-b1a3-4398-baf3-7c58af74cbec@s50g2000hsb.googlegroups.com...

On Oct 6, 11:45 am, Joseph <niroc...@gmail.com> wrote:
> I need to find a character of % in a datawindow find function. The
> find is built using a like clause and always appends a % at the end of
> the string. Any suggestions? Thx
>
> Example 1
>
> string ls_value = "ABC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is found for code value of "ABCD"
>
> Example 1
> string ls_value = "A%BC" + "%"
> dw_1.find ("code like" + ls_value,1,dw_1.rowcount())
>
> record is NOT found for code value of "A%BCD"

It looks like there are a limited number of options on how to search
for the value "%" in the FIND datawindow method. (I was hoping for a
special character match routine)
Looking for a solution to this issue about finding a ‘%’ value in a
string in the Find operation:

As you know, the % is a wildcard used for searching patterns within a
string. But what happens if you need to find an actual value of ‘%’
within the string? PowerBuilder Find function(s) works similar to the
of LIKE operator in ansi SQL. Unfortunately, there is no way in
PowerBuilder to use the operator LIKE and a value of ‘%” and a
wildcard all in the same search criteria. In order to look for the
actual value of a character of ‘%”, we need to forgo the LIKE
operator. This leaves with two options:

- USE operator, “=”. The “=” operator acts like an exact match
search. This means in order to find a string like “% - OTHOC”, the
user must type in the Find value field “% - OTHOC” in order to find
the record.
– Second option is to change the LIKE operator to a pattern matching
routine. Pattern matching works similar of having a default wildcard
ALWAYS in the beginning and at the end of the find value. However,
you cannot use the “%” value in a middle of a search and have
searching work as a wildcard. Example: searching for a value of “OT”,
it will find records like “% - OTHOC”, “OTCBNH”, “HGROTVG”, and
“HHHGOT”. Example2: searching for a value of “%”, will find records
like “%- OTHOC”, “OOO%LLL”, and “UIJ%”.

Unless there is a special character matching, I don't see any other
alternative.