On Jan 31, 2009, at 11:56 AM, Sibylle Koczian wrote:

> As far as I can see I can run ad-hoc queries against my database in  
> two
> ways:
>
> myBizobj.executeSafe(sql, params) # What's the return value? A  
> dataset?

        No, it's a cursor, although now that I think about it, a dataset  
might make more sense.

> or, a little longer:
>
> crs = myBizobj.getTempCursor()
> crs.execute(sql, params)   # Does that method return None? Or what?
> ds = crs.getDataSet()
>
> What's the difference, except the number of statements?

        Not a whole lot; the main purpose of the getTempCursor() method is to  
let developers who want to work outside of the framework do things  
that are specific to their app. Our main philosophy is to make it easy  
to do the basic things, but to never forbid doing anything else, as  
long as the developer is willing to assume the responsibility for the  
results. getTempCursor() allows a developer to do pretty much anything  
they want.

> In the mailing
> list archive I get only 4 hits searching for "executeSafe", all of  
> them
> from 2007: does that mean the method is deprecated, unimportant, not  
> the
> best choice in most cases, or what? Or everybody but me uses it  
> without
> problems and without questions? Or is it only good for
> INSERT/UPDATE/DELETE, because no data can be got from it?

        Not at all. The purpose of executeSafe() is to allow a developer to  
stay within the standard bizobj framework without disturbing the  
current data presented within the application. We don't want high- 
level developers to ever feel that they cannot do what they need by  
using our framework.

> Additional question: what's the return value from dBizobj.filter()? A
> dataset?

        The return is None. It filters the bizobj's data in-place. You can  
later undo that by calling biz.removeFilter().


-- Ed Leafe




_______________________________________________
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