SQL Exception Problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Commerce suite > SQL Exception Problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SQL Exception Problem  
Gil Lopez


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-04 11:29 PM

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 >= (VALUES
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 to
the end of the string but that doesn't help.  I am running DB2 8.1 with WCBE
5.5.  Any help would really be appreciated.









[ Post a follow-up to this message ]



    Re: SQL Exception Problem  
Robert Brown


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:51 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register