Sibylle Koczian wrote:
> Hello,
> 
> I just tried some things I couldn't find out from the documentation, and
> I would like to know if my conclusions are correct:
> 
> - Table alias
> The method addFrom() optionally takes an alias for the table name and
> this alias, if present, can and must be used for addFields(), addJoin(),
> addWhere() calls. But addJoin() has no place for an alias for the joined
> table, right? So I have this in my bizobj code:
> 
> def initProperties(self):
>     ...
>       self.addFrom("mainTable", "mt")
>       self.addJoin("lookupTable", "mt.fkid = lookupTable.fkid")
>       self.addField("mt.Field1", "mtf1")
>       self.addField("lookupTable.NameFld", "lname")
>       self.addWhere("mt.Field2 = ?")
>       self.addWhere("lookupTable.DateFld > ?")
>       ...
>       
> - Field alias
> The alias names used in the addField() calls can be used for DataField
> properties in the application windows, but they can't be used in the
> SQL, for example in addWhere(), right?
> 
> - set...Clause methods
> The setWhereClause() method takes a correctly constructed WHERE clause
> _without_ the word "WHERE", but the clause used in a setJoinClause()
> call _must_ start with "JOIN", right? And here table aliases for the
> joined tables can be set and used in other calls building the SQL. Still
> correct? How about the other set...Clause methods, do they or don't they
> have to start with the appropriate SQL keyword?
> 
> Are there any examples for bizobjs with changing queries according to
> user input?

I have no real answers to your questions just because i didn't come into
the situation to test all this.
When i have complicated search forms i build my query myself as this
seemed to be much easier than using the sqlbuilder.

Maybe a selectable stored procedure would help too.
One thing you have to make sure is that you do not use the same bizobjs
for queries and for edits. That means you have to use browser forms and
edit forms. Bizobjs on my browser form often use joins to add
searchfields from additional tables, but i try to have only one grid
for browsing. Once the searchform found something, the user calls
additional forms for editing.

I'm sure Ed has to say more about your questions.

Uwe

_______________________________________________
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