passings vars to sql method
Zopists, I run into a problem. I have a DTML Methos that call an SQL Method. The SQL method, displayTasks, has two parameters, userID and statusID. The DTML method does have access to the variables userID and statusID prior to calling the sql method with a <!--#in--> tag. The DTML method looks like this: <!--#var standard_html_header--> <H2> <!--#var document_title--></H2> <P><b><!--#in getUsers--><!--#var name--><!--#/in--></b></P> List of tasks: <form action=displayUser method=post> <SELECT NAME=statusID> <!--#in listStatus--> <OPTION VALUE=<!--#var statusID-->><!--#var keyword--> <!--#/in--> </SELECTED> <input type=hidden name=userID value=<!--#var userID-->> </form> <table> <!--#in displayTasks--> <tr><td><!--#var taskID--></td><td><!--#var description--></td><!--#var priority--><td><!--#var </td></tr> <!--#/in--> </table> <!--#var standard_html_footer--> THE SQL methos look like this: select * from task_schedule where task_schedule.userID = <!--#sqlvar userID type=string--> AND task_schedule.statusID = <!--#sqlvar statusID type=int--> -------------------------------------------------- I basically can't run the query because it cannot get a value for userID or statusID. How do I pass these vars to the sql method from a dtml method??? Thanks in advance, Fredy Villa FVilla@GestaltTechnology.com
On Mon, 22 Mar 1999, Fredy Villa wrote:
Zopists,
I run into a problem. I have a DTML Methos that call an SQL Method. The SQL method, displayTasks, has two parameters, userID and statusID.
The DTML method does have access to the variables userID and statusID prior to calling the sql method with a <!--#in--> tag.
The DTML method looks like this:
<SNIP>
-------------------------------------------------- I basically can't run the query because it cannot get a value for userID or statusID. How do I pass these vars to the sql method from a dtml method???
Freddy, did you make the variables you are passing to your SQL method parameters of the SQL method? If not they won't be looked up in the request, they will only be searched via acquisition. This is described in the Z SQL guide where it shows the order of lookup for SQL method parameters. Have fun!
Thanks in advance,
Fredy Villa FVilla@GestaltTechnology.com
------- Jordan B. Baker -- jbb@spyderlab.com weaving the web @ http://www.spyderlab.com
participants (2)
-
Fredy Villa -
Jordan B. Baker