On Monday 09 March 2009 02:33:03 pm Uwe Grauer wrote:
> johnf wrote:
> > I have a small table that contains the counties of California and Nevada.
> >
> > The data will be used in a dropdown list. I intend to use the "State"
> > dropdown to trigger the setting of the where clause of the dropdown for
> > the counties.
> >
> > My question what are your thoughts on the best way to filter the cursor
> > based on the selected state.
> >
> > I see two ways. One using the dataset - something like
> > datasetCursor.execute ("select * from dataset where state = '%s'" %
> > (self.statecontID.Value))
> >
> > Or I could set the where clause.
> > self.BizObj.setWhereClause("state = '%s'" %(self.statecontID.Value))
> >
> > Your recommendations would be very helpful.
>
> If your result set isn't too big (< 1 second fetch time) i would prefer
> to use a whereclause and refetch the records.
>
> BTW better use the dbapi parameter substitution:
> self.BizObj.setWhereClause("state = ?")
> self.BizObj.setParams(self, (self.statecontID.Value,))
>
> Uwe
The current dataset is very small < 100. But I guess if you had all 50 states
it might be something to be concerned about.
--
John Fabiani
_______________________________________________
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]