[Zope-DB] RE: Text in Query Question

Fernando Martins fmartins@hetnet.nl
Mon, 30 Jun 2003 19:31:22 +0200


I'm not the original poster. I think the original poster wanted to have
snippets of ZPT code in the Description column. So, (s)he wanted to show the
Description with the code rendered. The snippet of ZPT code in itself was
also running a query (against another table).

Regards,
Fernando

From: Chan YH [mailto:cyhoong@pc.jaring.my]
> I am not sure of if  I understand you correctly?  If you want search text
> within
> the description column:
>
> You want to try this:
>
> sql_query:
> ----------
> select * from artshow
>  where
>       <dtml-sqltest art_id type="string">
> and
>       <dtml-sqltest description op="like" type="string">
>
> Method:
> --------
>  <a href="artshow_action?art_id=<dtml-var art_id>&amp;art_desc=<dtml-var
> art_desc>"></a>
>
> Note: this is database dependant. I am using
> Postgresql/Zop2.51/psycopgDA114.
>          The method above will pass 2 variables (art_id and
> desc_query_string) to sql_query.
>          You can use wildcard char (%) in the desc_query_string
> (eg. New%).
>