>Hi - is it possible to use a view to return records that match the primary keys in a list?
>I have a view with this SQL
>
>SELECT *;
> FROM youthbase!ygprojects;
> WHERE Ygprojects.pj_primary IN (?vRange)
>
>
>I have tried passing it...
>strRange = "17,66,89"
>vRange = &strRange
>vRange = evaluate(strRange)
>but neither work - sometimes I get an error and sometimes I just get the first record returned
>
>If I put the values directly in the view I get the 3 records back OK
>
>Any ideas greatly appreciated
This will work but it's kind of ugly...
CREATE SQL VIEW testsub as select * from clients where pk_clients in (select pk_clients from cClientList)
You just have to populate the subquery table before using the view, which you could do with a cursor created just for that purpose, e.g.:
create cursor cClientList (pk_clients i)
insert into cClientList values (103)
insert into cClientList values (259)
insert into cClientList values (31245)
requery('testsub')
etc..
-Rick