[Zope] Newbie - parameterized query...
Kevin Carlson
khcarlso at bellsouth.net
Thu Dec 4 07:48:29 EST 2003
fowlertrainer at anonym.hu wrote:
>-------
>ss=context.REQUEST.SESSION
>r=0
>uusr=usr.lower()
>result=context.LoginScripts.dbcheckUsrPwd(uusr,pwd)
>if len(result)>0:
> r=1
> ss['userid']=row[0]
> ss["username"]=usr
> ss["full username"]=row[1]
>return(r)
>
>zsql:
>-----
>params: usr,pwd
>
>select * from inst_prguser
>where
> webusr=<dtml-sqlvar usr type="string">
>and
> webpwd=<dtml-sqlvar pwd type="string">
>
>The result is: "Missing input variable, usr".
>
>
>
You need to specify the arguments as keywords when calling a ZSql
method. Try this:
result = context.LoginScripts.dbcheckUsrPwd(usr=uusr, pwd=pwd)
Hope that helps,
Kevin
More information about the Zope
mailing list