You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Scherler, Thorsten" <Th...@weidmueller.de> on 2002/11/13 17:59:47 UTC

esql / xsp <- query for date

Hello group,

I have a big problem!

I want to do the following:

I have a query on a database. It is working fine!

I can do the following with every field but the date:
e.g.
http//...?id=1

but as soon as I but ?date='11.11.2002'

it blows!

So trying the following blows it too:
<esql:query>
select * from IDM_info where Info_datum = '11.11.02'
</esql:query>

My db is access 97 but that should be ok because I use the odbc:jdbc - bridge.

So how can I get all data where the date is e.g. 13.11.2002?

> Mit freundlichem Gruss,
> 
> Thorsten Scherler
> Marketing / Telefonmarketing
> 
> Weidmüller GmbH & Co.
> P.O. Box 2807
> 33058 Paderborn
> Tel.:+ 49 - 5252-960-350
> Fax:+ 49 - 5252-960-116
> eMail: thorsten.scherler@weidmueller.de
> http://www.weidmueller.de
> 
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: esql / xsp <- query for date

Posted by Erik Bruchez <er...@bruchez.org>.
Not 100% related to your date narrowing issue, but the modern way to 
pass date and time literals in JDBC is with escape sequences, e.g.:

UPDATE Orders SET OpenDate={d '1995-01-15'}
WHERE OrderID=1023

I have no idea if this will work with Cocoon (it should) or with your 
JDBC driver (it works with the latest MS SQL Server driver). JDBC 
provides escape sequences for date and time literals, outer joins, 
scalar functions, and procedure calls. The obvious benefit is that this 
allows writing JDBC code that is more portable.

-Erik

Scherler, Thorsten wrote:

> Hello group,
>
> I have a big problem!
>
> I want to do the following:
>
> I have a query on a database. It is working fine!
>
> I can do the following with every field but the date:
> e.g.
> http//...?id=1
>
> but as soon as I but ?date='11.11.2002'
>
> it blows!
>
> So trying the following blows it too:
>
> select * from IDM_info where Info_datum = '11.11.02'
>
>
> My db is access 97 but that should be ok because I use the odbc:jdbc - 
> bridge.
>
> So how can I get all data where the date is e.g. 13.11.2002?
>
>
> >Mit freundlichem Gruss,
> >
> >Thorsten Scherler
> >Marketing / Telefonmarketing
> >
> >Weidmüller GmbH & Co.
> >P.O. Box 2807
> >33058 Paderborn
> >Tel.:+ 49 - 5252-960-350
> >Fax:+ 49 - 5252-960-116
> >eMail: thorsten.scherler@weidmueller.de
> >http://www.weidmueller.de
> >
> >
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.
>
> To unsubscribe, e-mail:
> For additional commands, e-mail:





---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>