Solved

Interactive 'WITH' Statement

Posted on 2009-05-14
2
191 Views
Last Modified: 2012-05-07
Sample code not working and I don't see why.  Any suggestions?
Token ( was not valid. Valid tokens: FOR WITH FETCH ORDER UNION EXCE 
 WITH MYTABLE AS (SELECT DDCREW, DDDRV#,                              
   DATE(DDYEAR || DDMOTH || DDDAY) As strdate, ddmd from cdsddm)      
 select * from MYTABLE                                                
   where dddrv#=2523                                                  
    and strdate = 20090316

Open in new window

0
Comment
Question by:lynn_harris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Dave Ford earned 50 total points
ID: 24390015

Since my date-format is *ISO, the following works for me:

WITH MYTABLE AS (
  SELECT 2523 as DDDRV#,
         DATE('2009' || '-' || '03' || '-' || '16') As strdate
  from   sysibm/sysdummy1)
select *
from   MYTABLE
where  dddrv#=2523
  and  strdate = '2009-03-16'
 
HTH,
DaveSlash

Open in new window

0
 

Author Closing Comment

by:lynn_harris
ID: 31581707
Thank You.  I will toy with my some more.  
0

Featured Post

Schedule a Tour of the ATEN booth at InfoComm 2017

Tour the ATEN booth to see the the Latest Addition to the Modular Matrix Switch Series, New 4K HDMI Over IP Extender and more! Enter ATEN's Ultimate Giveaway Sweepstakes for a chance to win one of several great prizes, including an ATEN US7220 2-Port Thunderbolt 2 Sharing Switch!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question