08-27-04 11:29 PM
Change TIME with TIMESTAMP
+"AND T1.CLOSE_TIME <= (VALUES CURRENT TIMESTAMP) AND T1.OPEN_TIME >=
(VALUES CURRENT TIMESTAMP) "
R
Gil Lopez wrote:
> Hello. I have a session bean that extends the BaseJDBCHelper. I have the
> following SQL string (where PTXSTOREAVAIL is a custom table):
>
> private static final String FIND_STORES_SCHEDULED_TO_CLOSE_SQL =
>
> "SELECT T1.STORE_ID FROM PTXSTOREAVAIL T1, STORE T2 WHERE T1.ACTIVE = 1 "
>
> +"AND T1.MARKFORDELETE = 0 AND T1.DAY_ID = (VALUES DAYNAME (CURRENT
> TIMESTAMP)) "
>
> +"AND T1.START_DATE <= (VALUES CURRENT TIMESTAMP) AND T1.END_DATE >= (VALU
ES
> CURRENT TIMESTAMP) "
>
> +"AND T1.CLOSE_TIME <= (VALUES CURRENT TIME) AND T1.OPEN_TIME >= (VALUES
> CURRENT TIME) "
>
> +"AND T1.STORE_ID = T2.STORE_ID AND T2.STATUS = 1";
>
>
>
> However, when I try to run this statement, I get the following error:
>
> SQL0104N An unexpected token ""TIME"" was found following "E <= (VALUES
> CURRENT". Expected tokens may include: "<space>". SQLSTATE=42601
>
> This query runs fine from the command line. I tried adding a semi colon t
o
> the end of the string but that doesn't help. I am running DB2 8.1 with WC
BE
> 5.5. Any help would really be appreciated.
>
>
>
>
[ Post a follow-up to this message ]
|