I am a python/web2py newbie. I am trying to create a user friendly web search form for clients that connects to our existing Oracle DB and executes a query based on search criteria put in the form by users.
For example, user will fill out the form saying first_name = "John" , last_name="Smith" and when they submit, it will output for them all the information in the database for John Smith.
I am using DAL to connect to the existing external Oracle DB
my_db = DAL('oracle://username/password <at> Database')
I am using simple FORM to create the form as I could not figure out how to use SQLFORM etc. because those seem to want me to create/define tables which I do not want to do as the table already exists and which do not want to modify. This is purely a query program.
My display_form is something like this
form = FORM('First Name' INPUT(_name='first_name'),
'Last Name' INPUT (_name='last_name'),
session.first_name = request.vars.first_name
session.last_name = request.vars.last_name
return dict (form=form)
sql = "SELECT * from Table 1 where field1 = session.first_name and field2 = session.last_name "
rows = my_db.executesql(sql)
Then the next.html is
<h1>Here is your query results.</h1>
This works fine except that output is in this format:
What is the easiest way to output this in a html table output?
I would also like to provide xls output option.
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