cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Muench" <smue...@us.oracle.com>
Subject Re: How to do formatting of dates and times with SQLProcessor
Date Fri, 03 Dec 1999 15:42:29 GMT
Donald,

Can't you just rely on the database to format
the date in the format you want and keep the
<query> tags simpler?

  SELECT TO_CHAR(hiredate,'Month DD, YYYY) as hiredate
    FROM EMP
      :

Databases have pretty evolved number/date formatting
routines that handle all the NLS/locale issues already.

Seems like a problem that you could push down a layer
and keep the model simpler in the "page"...

Just a thought.

_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml
----- Original Message -----
From: Ed Ward <ed@waterfall.freeserve.co.uk>
To: <cocoon-dev@xml.apache.org>
Sent: Friday, December 03, 1999 6:53 AM
Subject: Re: How to do formatting of dates and times with SQLProcessor


On Fri, 3 Dec 1999 00:31:58 -0500 (EST), you wrote:

>Hi guys. I'm trying to figure out how to configure SQLProcessor to format
>dates and times nicely. The naive approach would be something like this:
>
><query date-format="yyyy-MM-dd" time-format="hh:mm:ss"
>timestamp-format="yyyy-MM-dd hh:mm:ss">
>
>but suppose you have more than one date column and you want to specify
>different formats for the different columns? One of my local users
>suggested this:
>
><query>
> <date-format>yyyy-MM-dd</date-format>
> <date-format column="other_column_name">MMM d, yyyy</date-format>
></query>
>
>which might work, but it's a break from the tradition of putting all
>resultset configuration options in the query element. It does, however,
>greatly simplify setting column-specific options. Does anyone have either
>an argument to make for one of these options or an alternate suggestion?
>
>- donald
>

How about :

<query>
<column name="date1" format-type="date" format="yyyy-MM-dd">
</query>


It still doesn't solve your problem of breaking from the tradition of
keeping
all the configuration options in the query element, but its not so tied to
the
problem of formatting dates.

ed.


Mime
View raw message