Okay... but why? That's what I'm trying to figure. Instead of doing a
prepare statement, I've just broken it up. Create table first, then insert
table.
--
Michael Schutte
Admin Professional
BIG FARM SALADS: Made when you're ready, not ready made.
Try our NEW Savor-Size Country Caesar Salad for 5.99!
For more information, visit BobEvans.com
"sjl"
<sjl_abc@hotmail.
com> To
Sent by: rpg400-l@xxxxxxxxxxxx
rpg400-l-bounces@ cc
midrange.com
Subject
Re: CREATE TABLE AS ... WITH DATA
05/06/2009 05:37
PM
Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>
Michael -
You probably need a 'prepared' SQL statement to do this.
- sjl
<Michael_Schutte@xxxxxxxxxxxx> wrote in message
news:mailman.5570.1241640500.23468.rpg400-l@xxxxxxxxxxxxxxx
Doesn't anyone have a reason why host variables are not allowed in the
SQLRPGLE program when trying to build a qtemp table with data.
CREATE TABLE QTEMP/HTOPERIODS AS (
WITH cte as (
SELECT DISTINCT HTOER, HTOPER
FROM HRCSTFA/CUPHTO
WHERE HTOER = :COMPANY <<--- not permitted
AND HTOPER <= :PERIOD <<--- not permitted
Order by HTOER, htoper DESC)
SELECT a.*, row_number()
OVER(PARTITION BY HTOER ORDER BY HTOPER DESC) ROWNBR
FROM cte a
ORDER BY HTOER, HTOPER DESC) WITH DATA;
Haven't been able to find a reason, but I might not have the right search
term.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.