I do not understand the following in the book:

*The fields argument is a list of DAL Field objects that match the fields
returned from the DB. The Field objects should be part of one or more Table
objects defined on the DAL object. The fields list can include one or more
DAL Table objects in addition to or instead of including Field objects, or
it can be just a single table (not in a list). In that case, the Field
objects will be extracted from the table(s).*

*Instead of specifying the fields argument, the colnames argument can be
specified as a list of field names in tablename.fieldname format. Again,
these should represent tables and fields defined on the DAL object.*

*It is also possible to specify both fields and the associated colnames. In
that case, fields can also include DAL Expression objects in addition to
Field objects. For Field objects in "fields", the associated colnames must
still be in tablename.fieldname format. For Expression objects in fields,
the associated colnames can be any arbitrary labels.*

*Notice, the DAL Table objects referred to by fields or colnames can be
dummy tables and do not have to represent any real tables in the database.
Also, note that the fields and colnames must be in the same order as the
fields in the results cursor returned from the DB.*

Can somebody please provide examples and explain to me:

* Why would one use a "fields argument" in executesql?

* Why would one use "colnames"?

* What is the difference here between "colnames" and "fields"

* Why would one use both?

* In which cases would using "dummy tables" be useful here?

* Why is this addition to db.executesql useful?


Regards

Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to