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



David's current rules:
SQL in general - MIDRANGE-L
SQL embedded in RPG: RPG400-L
SQL embedded in COBOL: COBOL400-L
SQL embedded in C: C400-L
ect..

I've been asking for a SQL specific forum for a while, simply because
to my mind, most of the SQL related questions are just SQL questions.
Irregardless of the statement being embedded in a language or not.

For instance:

If I ask, "Why doesn't this work in STRSQL?"

Select *
from mytable
order by fld1, fld2
where fld3 = 'ABC'

Given the current rules, it belongs in MIDRANGE-L.

But if I happen to be embedding it into an RPG/COBOL/C program
exec sql
declare c1 cursor for
Select *
from mytable
order by fld1, fld2
where fld3 = 'ABC';

Then it is ok to post the question in the language list.

Charles


On Tue, May 12, 2009 at 4:36 PM, <DLee@xxxxxxxx> wrote:
Thanks to everyone for all the responses.

Charles I typed in your Function, I should be testing it soon Thanks for
the time it took to paste it in I really appreciate that.
Rob, thanks for your explanation of values.
Eric I did download the iDate utility, thanks for the tip.  I'll for sure
be looking into that.
Vern, Thanks for the response, I'm just getting into SQL SP's, I've done a
few External Stored procedures that are working, but have never gone deep
into sql itsself.

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

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


Thanks again to all

Darrell Lee
Information Technology
Extension 17127
--
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.