Re: Can I join tables from different databases?

Steve M <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <DM6PR04MB6891B8D851E17890FBFD1F238864A@DM6PR04MB6891.namprd04.prod.outlook.com>
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-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> on behalf of gio.cot via RPG400-L <[email protected]>
Sent: Sunday, February 8, 2026 7:57:33 AM
To: 'RPG programming on IBM i' <[email protected]>
Cc: gio.cot <[email protected]>
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: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.

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

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.