cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: ' in SQL String causes problems?
Date Mon, 11 Sep 2000 19:08:07 GMT
On Wed, 6 Sep 2000, David A Powell wrote:

> 
>                 <sql:query>SELECT TO_CHAR(t.MY_TIMESTAMP,'HH:MM:SS AM') FROM
> mytable t</sql:query>   <!-- The original query is more complex -->
> 
>                 <sql:count-attribute>count</sql:count-attribute>
>         </sql:execute-query>
> 
>   </root>

1. use the 'AS' operator to rename your column to a valid XML element
name.

2. use the new esql logicsheet:

<esql:execute-query>
 ...
 <esql:query>select to_char(t.my_timestamp,'hh:mm:ss am') from mytable t</esql:query>
 <esql:results>
  <timestamp><esql:get-string column="1"/></timestamp>
 </esql:results>
</esql:execute-query>

or perhaps even better, use standard SQL and do the date formatting in the
logicsheet:

<esql:execute-query>
 ...
 <esql:query>select my_timestamp from mytable</esql:query>
 <esql:results>
  <timestamp><esql:get-timestamp column="1" format="hh:mm:ss zz"/></timestamp>
 </esql:results>
</esql:execute-query>

- donald


Mime
View raw message