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"
HTH,
Ken
"Joseph" <niro...@gmail.com> wrote in message
news:3441e6a2-2de7-4b67...@v28g2000hsv.googlegroups.com...
Or just use the pos function instead.
dw_1.find ("pos(code, '"+ls_value+"')>0",1,dw_1.rowcount())
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.
"Joseph" <niro...@gmail.com> wrote in message
news:0e969c1e-b1a3-4398...@s50g2000hsb.googlegroups.com...