cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject RE: Probs with INSERT and esql
Date Sun, 25 Feb 2001 03:52:26 GMT
On Sat, 24 Feb 2001, Jon Brisbin wrote:

> <esql:execute-query>
>     <esql:query>
>         <xsp:logic>
>             StringBuffer sql = new StringBuffer("insert into new_address
> values(");
>             sql.append(" '").append(request.getParameter("member_id"));
> 		...
>             System.err.println(sql.toString());
>             <xsp:expr>sql.toString()</xsp:expr>
>         </xsp:logic>
>     </esql:query>

good lord. esql:query doesn't let you put _logic_ inside it. read the
schema and/or the examples - i hope i've made that clear, if nothing else.
anyway, i'd do this:

<xsp:logic>
  if (request.getParameter("member_id")) {
    <esql:query>
      insert into whatever_table values (
      <esql:parameter><xsp:expr>request.getParameter("member_id")</xsp:expr></esql:parameter>
      )
    </esql:query>
  }
</xsp:logic>

- donald


Mime
View raw message