On 11/8/13 7:36 AM, John Fabiani wrote:
> On 11/08/2013 06:52 AM, Ricardo Aráoz wrote:
>
> I use the getTempCursor() all the time. I create some thing like
getTempCursor() is the best way to go IMO.
> tc=self.PrimaryBizObj.getTempCursor()
>
> sql = some sql statement
>
> tc.execute(sql)
Or:
tc = self.PrimaryBizobj.getTempCursor(sql, params)
if tc.RowCount:
print tc.Record.cust_name
else:
print "no records."
> if I have a small dataset and need to manipulate the dataset I will use
> something
> like this:
>
> ds = self.listData.getDataSet()
>
> self.txndata = ds.execute("select * from dataset where somefield = %s")
>
> I have discovered that using the dataset (as in above) and having a large
> dataset
> that the performance in not very good. So I will just make a new query.
If you want to subfilter the tempcursor from above, it would be:
ds = tc.getDataSet()
ds.execute("select * from dataset where cust_state='CA'")
if ds:
for row in ds:
print ds["cust_name"]
else:
print "no records."
> I don't use filters very often. So I can't really comment.
There are some corner-cases that aren't covered and that I don't fully
understand.
Use filter() with caution.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]