Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread How to pass a date parameter to EWB server?
Wed, Feb 12 2014 9:33 AMPermanent Link

Uli Becker

This is the definition of a dataset in EWB server:

select * from laborwerte L
join Anforderungen A
on L.AnforderungenID = A.AnforderungenID
where A.Datum = {Datum=CURRENT_DATE}
and Parameter <> 'KASSE' and parameter <> 'PRIVAT'

I couldnt't find out how to format the date param when loading the dataset.

Thanks Uli
Thu, Feb 13 2014 8:48 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< This is the definition of a dataset in EWB server: >>

Dates/times should be formatted according to the requirements of the
database engine being used.  So, for DBISAM/EDB, you would use

select * from laborwerte L
join Anforderungen A
on L.AnforderungenID = A.AnforderungenID
where A.Datum = {Datum='2014-01-01'}
and Parameter <> 'KASSE' and parameter <> 'PRIVAT'

Tim Young
Elevate Software
www.elevatesoft.com

Thu, Feb 13 2014 12:53 PMPermanent Link

Uli Becker

Tim,

> Dates/times should be formatted according to the requirements of the
> database engine being used.  So, for DBISAM/EDB, you would use
>
> select * from laborwerte L
> join Anforderungen A
> on L.AnforderungenID = A.AnforderungenID
> where A.Datum = {Datum='2014-01-01'}
> and Parameter <> 'KASSE' and parameter <> 'PRIVAT'

That's what I tried first. But both in the preview an error is displayed
(Expeced date expression but instead found '2014-2-1') and the request
results in a 500 error.

Uli
Fri, Feb 14 2014 9:04 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< That's what I tried first. But both in the preview an error is displayed
(Expeced date expression but instead found '2014-2-1') and the request
results in a 500 error. >>

Sorry, I forgot that you were using ElevateDB - you need to use this
instead:

select * from laborwerte L
join Anforderungen A
on L.AnforderungenID = A.AnforderungenID
where A.Datum = DATE {Datum='2014-01-01'}
and Parameter <> 'KASSE' and parameter <> 'PRIVAT'

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 14 2014 9:48 AMPermanent Link

Uli Becker

Tim,

> where A.Datum = DATE {Datum='2014-01-01'}

thanks. Actually I thought about this, but I tried

where A.Datum = {Datum=date'2014-01-01'}

without success. Smiley

Uli
Tue, Feb 18 2014 11:23 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< thanks. Actually I thought about this, but I tried >>

Yeah, the DATE, TIME, or TIMESTAMP symbols must be outside of the parameter
specification.  This is especially true with 1.03, which sanitizes the
parameters and insists that they only be a single token.  This prevents
someone from trying to tag on extra commands, etc. via SQL injection
techniques.

Tim Young
Elevate Software
www.elevatesoft.com
Image