Hi,
This is a "Is there a better way" question.  Am I doing it the best way.

Currently, when I need a special dataset (in this case for a grid) I have been 
doing something similar to the following:

1. I create an SQL string
csql = """select distinct x.* from (select pkid,lname, fname, born, 
city,homephone, state_1,(select caseno from esenroll where 
esenroll.fk_clientid = esclient.pkid) as case_num  from esclient where 
lower(lname) = '%s' union all select pkid, lname, fname, born, city,homephone, 
state_1,(select caseno from esenroll where esenroll.fk_clientid = 
esclient.pkid) as case_num  from esclient where born = '%s'::date union all 
select pkid, lname, fname, born, city,homephone, state_1,(select caseno from 
esenroll where esenroll.fk_clientid = esclient.pkid) as case_num  from 
esclient where homephone ='%s') x""" % 
(self.lastName.lower(),self.dobDate,self.phoneNum )

clear the sql for the bizobj
2.  self.Form.esclient.UserSQL = None

set the the sql

3.  self.Form.esclient.UserSQL = csql

and requery

4.  self.Form.esclient.requery()

Then use the dataset in my grid or where it is needed.  

This works - but maybe there is a better way to use the framework to get the 
job done.

I have considered using a View.  And I have not discounted it.

In this case a View would work well but using a View only changes the way I 
call the sql.

I have always wondered if there where better ways to deal with a dynamic 
changing datasets.  Is there a way to setup the bizobj in createBizobj that 
would allow the dynamic dataset to follow a bizobj?  For example is there 
someway to use the ParentLinkField and LinkField of a bizobj to allow a one to 
many relationship to follow multi-where parameters?

Johnf


       
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to