Prev: SQL0901N Error.
Next: Convert DECIMAL to DATE
From: J. Moreno on 7 Apr 2006 19:23 Serge Rielau <srielau(a)ca.ibm.com> wrote: > J. B. Moreno wrote: > > Knut Stolze <stolze(a)de.ibm.com> wrote: > > > >> J. Moreno wrote: > >> > >>> Knut Stolze <stolze(a)de.ibm.com> wrote: > > -snip- > >>>> If your actual SQL statement is a query, you could use a common > >>>> table expression to have just the original two parameter markers: > >>>> > >>>> WITH parms(p1, p2) AS ( VALUES (CAST(? AS INT), CAST(? AS INT)) > >>>> SELECT ... > >>>> FROM <table>, parms > >>>> WHERE table.col1 < parms.p1 AND table.col1 > parms.p2 AND ... > >>> That sounds good -- but I can't get it to work.... -snip- > > Too bad I can't get this to work (it'd be ideal for the query that I'm > > working on, which involves two subquery's that are almost identical). > > J.B., > > What platform are you on. Knut is referring to DB2 for LUW. > DB2 for iSeries or zOS do not support WITH clause yet. That's it -- I'm on zOS. Guess I'm stuck with the repeated subqueries... -- J. Moreno |