[Zope] Newbie - parameterized query...

Andreas Jung lists at andreas-jung.com
Thu Dec 4 07:41:22 EST 2003


Try to pass the arguments as keyword parameters.

-aj

P.S. and stop cross-postings over several lists

--On Donnerstag, 4. Dezember 2003 13:33 Uhr +0100 fowlertrainer at anonym.hu 
wrote:

> Hello ,
>
>   My problem is that:
>
>   I have ZPT pages, and scripts. I want to check some infos with SQL
>   query.
>
>   This an example:
>
> script:
> -------
> 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".
>
> I think this is wrong in zsql - it have wait for dtml-var.
> But how to I do it in good way to the zsql get good parameters ?
>
> Thanx.







More information about the Zope mailing list