On Thursday, August 11, 2011 09:11:56 am Vineet Deodhar wrote:
> Another query in this regard -- How do I get all the records from 'dist'
> table? (without getting filtered by statid=somevalue?)
> ============================
Ouch! That question is somewhat harder to answer. The cause of the trouble
is that you already have created a connect to the table 'dist' and you have
setup a filter(parent->child relation). In general Dabo does not have a "use
table again" feature.
When I need to open the same table multiple time I do one of the following.
I create a view on the database server. I of course name the view something
different from the other tables. Then I use the view just like any other
table. The only issue is normally a view is read only. I use the postgres
database and Postgres allows special rules to allow insert,update, and
deletes. I'm sure what MySQL has available for views.
The second way is to provide Dabo with all the information it needs to create
a bizobj that matches the data structure of the table in question and handle
all the methods required to save, update, delete, read. see below to see how
to execute the save,update, etc..
And the last way (might work depending on what you need to do with the data
set). Just create a dynamic data set by using a direct sql statement.
The steps are:
#get a cursor to hold the data
self.biztmp = dabo.biz.dBizobj(self.conn)
# get a temp cursor to work with where self.conn is the connection to the
database
self.tmpbiz = self.biztmp.getTempCursor()
# you can execute any sql statement next including joins etc..
self.tmpbiz.execute("Select * from dist")
myDataSet = self.tmpbiz.getDataSet()
myDataSet now contain all the records retrieve from the table dist
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]