cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject XSP SQL Taglib: using bind variables
Date Tue, 11 Jul 2000 07:05:03 GMT
It seems to me that the XSP SQL Taglib would need to support bind
variables, in order to perform queries with variable parameters, without
resorting to concatenation, which inevitably gives quoting problems.

This is what I am presently doing in order to specify a parametrized
query:

        <sql:query>
          select column_list from table
          where column_name =
            <xsp:expr>
              "'" + request.getParameter("param") + "'"
            </xsp:expr>
        </sql:query>

And this is what I would like to do (just a rough outline):

      <sql:execute-query>
        <sql:variable type="string">
          <xsp:expr>
            request.getParameter("param")
          </xsp:expr>
        </sql:variable
        <sql:query>
          select column_list from table where column_name = ?
        </sql:query>
      </sql:execute-query>

Before I start reinventing the wheel, has anybody given any thought
about this, or even implemented something?

--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it

Mime
View raw message