Used to do this with Oracle all the time. IBM didn't (then) have the capability to Alias to another system, but Oracle did/does.
I'd build an Alias reference to the DB2 instance within Oracle (a one-time thing). Then in the program open the JDBC connection, then run the SQL statement within Oracle. Kind of counter intuitive, but worked without issues.
I'd write it all in DBeaver first, within the Oracle connection, to ensure the syntax and results before coding the SQLRPGLE program.
Hope that helps.
Steve M.
Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<
https://aka.ms/AAb9ysg>
________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of gio.cot via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>
Sent: Sunday, February 8, 2026 7:57:33 AM
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: gio.cot <gio.cot@xxxxxxxxxxx>
Subject: Can I join tables from different databases?
Hi all
i would need to execute SQL statement (in RPGLE program) that join a IBM i
Table with a MySql table that is stored in a external data base (windows
server) ...
in your opinion is it possbile ??
Thanks in advance
Gio
--
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@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.