You could create a stored procedure to retrieve the email from the linked server. Then the RPG just calls that stored procedure.

Scott Mildenberger | Software Developer | Washington Corporations | 101 International Drive | Missoula, MT 59808 | Office: (406) 523-1536 | www.washcorp.com

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Steve M via RPG400-L
Sent: Tuesday, November 12, 2019 10:26 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: Steve M <txpenguin1@xxxxxxxxxxx>
Subject: SQL Linked Server from RPGLE

I have successfully been using an adaptation of Scott Klement's JDBC connection process to access Oracle for quite some time.



Now, I need to access ADSI in our SQL Server world in order to retrieve email addresses. Within the MS SQL Server Management Studio, I am able to execute the appropriate commands to add a linked server, log in to that linked server, and then execute an SQL select against the linked server using OpenQuery against the ADSI connection.



The time is now to write all of this inside of an RPGLE so the program so it can dynamically create the connection, put the user's employee number in the SQL Where clause, and retrieve a user's email address, from the ADSI, as needed.



Has anyone successfully done this in the past? Is there another method? I am assuming, just like I used Scott's JDBC example I can use his ODBC example, but the linked server part has me a little concerned.



I am not committed to this method if there is another way to make this process work.



Since this code will be embedded inside of an RPGLE program, I assumed this was the proper group to post to - if not, please let me know and I will repost elsewhere, if more appropriate.



Thanks for any and all assistance.



Steve Meisinger



--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

This email has been scanned by Washington Corporations using Message Labs Spam Filtering Technology. If this e-mail is SPAM that you no longer want to receive, please refer to the Spam or Junk Email Handling Process (https://washcorp.service-now.com/kb_view.do?sysparm_article=KB0011399). If you are experiencing any other e-mail problems, please call the IT Service Center at 855-WC-IT-NOW or x1212 from any office phone.

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.