LIKE CLAUSE

[login to unmask email]

LIKE CLAUSE
HI ALL..
We're on DB2V5 / OS390

I have an online program that is called from a POWERBUILDER application thru
Trans Global Messaging
we are attempting to do a name search, so the cursor is

Declare name cursor for
select name_first, name_init, name_last
from customer_name where
name_last like :input-field.

of course the query does not recognize the value of the input-field
which contains 'smith%'

is there a way to get the query to recognize the contents of input-field
this field is being passed by the powerbuilder screen. so it cannot be
hard-coded...



[login to unmask email]

Re: LIKE CLAUSE
(in response to ddlusk@HOUSEHOLD.COM)
Hi,

Just try initializing the field with '%%%%%%%...'.
Then you may end up with LIKE 'SMITH%%%%%' which will work.

Regards,

Michael Levine
Premier Data Services, Inc.



>HI ALL..
>We're on DB2V5 / OS390
>
>I have an online program that is called from a POWERBUILDER application thru
>Trans Global Messaging
>we are attempting to do a name search, so the cursor is
>
>Declare name cursor for
> select name_first, name_init, name_last
> from customer_name where
> name_last like :input-field.
>
>of course the query does not recognize the value of the input-field
>which contains 'smith%'
>
>is there a way to get the query to recognize the contents of input-field
>this field is being passed by the powerbuilder screen. so it cannot be
>hard-coded...
>
>
>


>
>



[login to unmask email]

Re: LIKE CLAUSE
(in response to Mike_Levine@TEKHELP.NET)
Is there any case sensitive issue over here as i have found many times the
application is trying to access the data via host variables and not able to
pick up mainly the lower case letters.Just check it out how name or last
name is stored in the table.

I think it can help u.

Thanks

Sanjeev





[login to unmask email]@RYCI.COM> on 12/21/99 08:11:54 PM

Please respond to DB2 Data Base Discussion List <[login to unmask email]>

Sent by: DB2 Data Base Discussion List <[login to unmask email]>


To: [login to unmask email]
cc:
Subject: Re: LIKE CLAUSE


Hi,

Just try initializing the field with '%%%%%%%...'.
Then you may end up with LIKE 'SMITH%%%%%' which will work.

Regards,

Michael Levine
Premier Data Services, Inc.



>HI ALL..
>We're on DB2V5 / OS390
>
>I have an online program that is called from a POWERBUILDER application
thru
>Trans Global Messaging
>we are attempting to do a name search, so the cursor is
>
>Declare name cursor for
> select name_first, name_init, name_last
> from customer_name where
> name_last like :input-field.
>
>of course the query does not recognize the value of the input-field
>which contains 'smith%'
>
>is there a way to get the query to recognize the contents of input-field
>this field is being passed by the powerbuilder screen. so it cannot be
>hard-coded...
>
>
>


>
>








[login to unmask email]

Re: LIKE CLAUSE
(in response to ssethi@LOT.TATASTEEL.COM)
Thanks to all whom responded, the solution was simple.
fill the comparison field with '%' then string in the value that
we're looking for . so if you wanted all variations of thomas
then the value which will do the comparison is 'thomas%%%%%%%%%%'
the qoutes are not present, but the query works.

thanks to deneepa, and using the right precompiler options (apostsql) compiler
options (apost)

Derez D. Lusk
Household International
Wood Dale, Ill.