× 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.



DLee@xxxxxxxx wrote:

<<SNIP>> I just took a look, I don't recognize another
midrange forum that references iSeries DB2 SQL.
Can you suggest one?

I guess that lists.midrange.com fails to mention SQL might be part of the problem. But the /correct/ forum instead of RPG400-L "RPG programming on the IBM i / System i", is the MIDRANGE-L "Midrange Systems Technical Discussion", when the SQL concern is not specific to the RPG language.

I guess perhaps I should return to nudging\hinting in my replies when I see off-topic. I guess also naming the better list\forum is worthwhile.

Weird, I just inserted the call to the date conversion
function, and now I get the following error:
34 Position 9 Token C1 was not valid.
Valid tokens: GLOBAL. where I wasn't getting this before.

33 SET WRKDAT = DRLTONUMSP(CURRENT_DATE); This is the function call 34 DECLARE C1 CURSOR FOR 35 36 SELECT PCCOCD , PCAGNT , PCPOLM ,PCCOVC, PCEFDT ,PCEXDT 37 ,INLNAM , INFNAM , AGNAME 38 39 FROM SPFILES/COVMST ........


Presumably the placement of the non-DECLARE code, that is the SET statement before a DECLARE is the problem. The DECLARE of the CURSOR must be before the actual executable code statements. As for /GLOBAL/ being allowed, the DECLARE GLOBAL TABLE I do not believe has any similar restrictions as to where it can be coded.

Also, there is the VALUES INTO syntax which can be used instead of SET.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.