[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-db
Subject:    Re: [Zope-DB] ZSQL Method
From:       "Matthew T. Kromer" <matt () zope ! com>
Date:       2002-04-15 15:37:41
[Download RAW message or body]

Rajan Singh wrote:

>I tried creating the following ZSQL Method but it gave
>me an error:
>
>
>select * from <dtml-sqlvar mytable_name type="string">
>

You just want

     select * from <dtml-var mytable_name>

Using dtml-sqlvar is asking for special formatting, e.g.

   <dtml-sqlvar mytable_name type="string">

is converted into the text

    mytable_name = 'valueofmytable_name'

with the appropriate string quoting for the value.

>
>
>The thing i wanted to achieve was to pass the name of
>the table as a parameter and then create an sql
>statement for it.
>
>Could please advise me on how to do it. I am using
>MySQL.
>
>Thank you.
>Rajan
>

-- 
Matt Kromer
Zope Corporation  http://www.zope.com/ 






[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic