Subject Re: [IBO] two ParamEdit & SQL search
Author William J Hill
Hello Gediminas,

>Sending again this, as there wasn't luck to handle it. What's is wrong
>using ParamEdits (used to provide params to SQL query) with several SQL
>params?

[lots of snips...]

>select s."Sokejo_ID" , s."Vardas" , s."Pavarde"
>from SOKEJAI s
>where
>s."Vardas" starting with ? /* Vardas */
>and
>s."Pavarde" starting with ? /* Pavarde */

> [VARDAS] = 'I'
> [PAVARDE] = <n> '' ]
>/// In Vardas ParamEdit was entered "I" - gives an empty dataset due to
>PAVARDE - NULL

> [VARDAS] = 'I'
> [PAVARDE] = 'K' ]
>/// Found matching record - right

> [VARDAS] = ''
> [PAVARDE] = '' ]
>/// Should get all records from the table - however ib_grid shows an empty


> [VARDAS] = ''
> [PAVARDE] = 'K' ]
>/// An empty dataset - should be 7 rows as there are such number records
>where surname (pavarde) starts with the "K"

1) change 'starting with' to 'like' in sql, e,g
select s."Sokejo_ID" , s."Vardas" , s."Pavarde"
from SOKEJAI s
where
s."Vardas" like :Vardas
and
s."Pavarde" like :Pavarde

2) When vardas or pavarde are null use '%' symbol.
3) Append '%' symbol to vardas and pavarde params.

Regards,
William.