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



Well, that's better than RTFM...

Anyway since I have a little time on my hands let me give it a shot:

MySql = that big ugly SQL you wrote;
Exec SQL Declare Statement S1;
Exec SQL Prepare S1 from :MySql;
Exec SQL Declare C1 Cursor for S1;
Exec SQL Open C1;
Exec SQL Fetch from C1 into :userp4;
dow SQLCOD <> 100;
RPGMail_addAddress(email: 'TO': userp4: userp4);
Exec SQL Fetch from C1 into :userp4;
enddo;
Exec SQL Close C1;

Other error handling not included, SQLCOD = 100 is end of file.

You don't have to declare and prepare the statement, it can be included directly in the cursor
declaration where S1 sits. Just replace S1 with 'that big ugly SQL you wrote'.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Adam Glauser
Sent: Thursday, September 11, 2008 3:33 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Need Help with Email from RPG

steve.dyke@xxxxxxxxxxxxxxxx wrote:
The sql string I have piut
together will retreive the email addresses I need. Now how do I
incorporate this sql into the RPG?

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/books/c092508602.htm

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.