× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.