Is it possible to use a session variable as a parameter in a SQL
"WHERE" clause?  See example below.

#assign value to session variable
session.mysession = ...

#use session variable in web2py DAL query
#*this works*
rows=db(db.table.column==session.mysession).select(...)

#use session variable in SQL query
#*this doesn't work* - 'no such column' error
#is there any way to do this?
rows=db.executesql('SELECT ...
    FROM ...
    WHERE  table.column = session.mysession;')

The obvious answer here is to just use what works (the DAL).  However,
I have some very complex queries already written in SQL and would
rather not have to go to the trouble of morphing them into web2py DAL
syntax.

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to