I just found a Technote about an enhancement as of IBM i 7.1 that enabled a DDM file that is created by CRTDDMF command to be used with SQL: SQL against DDM file works at 7.1.0 at https://www.ibm.com/support/pages/sql-against-ddm-file-works-710. A new parameter value was added to deliver this SQL support to a DDM file that is created by CRTDDMF command.
Original Message:
Sent: Wed August 21, 2024 09:16 PM
From: Satid S
Subject: Creation DB link on IBM i to access UDB DB2
Dear Daniel
Your are right that IBM i DDM file also works with mainframe. But keep in mind that mainframe LPARs that run LinuxOne OS do not natively work with IBM i DDM file. And in the past when there were several m/f OSes, not all of them work with IBM i DDM file either.
This mention of m/f makes me wonder how many companies that have IBM i also have m/f ? In my country, there are just three remaining (out of some 500) and they have no need to interoperate their m/f with IBM i at all. At best, they use just batch stream file transfer.
>>>> So I dare to say, that DB2-LUW might also work, if you find the correct form of the table name (which might simply be 'SCHEMA.TABLE' - but I'm not sure, because I never done that). <<<<
All DB2 RDBMS products in any platform support DRDA remote SQL and they all work with IBM i DRDA.
>>>> A fried of mine used DDM to access some tables on an Oracle server <<<<
This is not accurate. Oracle and MS SQL Server have their own additional products (used to be known as DRDA gateway) that enable them to interoperate with IBM DRDA but only through remote SQL, definitely not with IBM i DDM file. DDM and DRDA share foundational architecture but they are not exactly the same in high-level features. If a DDM file is actually created from SQL CREATE ALIAS statement, it should be called an alias to avoid confusion with a DDM file that is created by CRTDDMF CL command which should be called a DDM file. Another choice of remote SQL is to use JDBC (implying Java environment) or ODBC among these platforms.
>>>> Alternatively you can also use CREATE ALIAS localschema.alias FOR remotedatabase.remoteschema.remotetable to create an SQL alias to the remote table. This SQL alias is then (AFAIK) implemented as a DDM file of the system level - even for local aliases, DDM files are created. <<<<
What you described is DRDA remote SQL, not DDM file. Local DDM file implements SQL Alias but it has nothing to do with remote SQL. IBM i DDM file does not support remote SQL.
------------------------------
Satid S
Original Message:
Sent: Wed August 21, 2024 12:55 AM
From: Daniel Gross
Subject: Creation DB link on IBM i to access UDB DB2
Hi Satid,
what you wrote about DDM is not correct - using the RMTFILE(*NONSTD '....') parameter, you can also access files on other platforms using DRDA.
I used that to access data on a IBM z Mainframe without trouble. So I dare to say, that DB2-LUW might also work, if you find the correct form of the table name (which might simply be 'SCHEMA.TABLE' - but I'm not sure, because I never done that).
A fried of mine used DDM to access some tables on an Oracle server - but they had to purchase the Oracle DRDA feature to do that. And there is also a DRDA feature for Microsofts SQL Server.
Alternatively you can also use CREATE ALIAS localschema.alias FOR remotedatabase.remoteschema.remotetable
to create an SQL alias to the remote table. This SQL alias is then (AFAIK) implemented as a DDM file of the system level - even for local aliases, DDM files are created.
The basis of all this is always a correctly configured remote database entry in WRKRDBDIRE - that's the backend of all DRDA operations on IBM i.
Regards,
Daniel
------------------------------
Daniel Gross
Original Message:
Sent: Tue August 20, 2024 09:30 PM
From: Satid S
Subject: Creation DB link on IBM i to access UDB DB2
Dear DuckHyun
To do data access from one DB2 product on any platform to another, you use DRDA which is IBM's distributed SQL architecture. (DDM file works only between IBM i to another IBM i.)
From IBM i to another DB2, you first use WRKRDBDIRE command to add the target DB2 system and IP address. (This serves like a TCP/IP host table for DB2.) You also need to add IP routing entry to the target system as well if it is in a different IP network. Then you specify how to connect DRDA (no security, user ID only, or user + pw). Details can be read in this article https://powerwire.eu/wrkrdbdire-i-want-data-from-that-box/
To connect from DB2 in Windows to IBM i, it used to be that using a product named DB2 Connect is the way to go. I'm not sure if this still stands. Do Google with "ibm drda <platform name>" and you will find more.
If you use SQL for data access, you either use SQL CONNECT statement or 3-part name from your SQL statements. Google some more on these terms for more info. Or just ask more here.
------------------------------
Satid S
Original Message:
Sent: Mon August 19, 2024 05:38 AM
From: DuckHyun Yu
Subject: Creation DB link on IBM i to access UDB DB2
Hello
Is there any method to create db link from "IBM i" to DB2 UDB?
There are many information to create db link from DB2 UDB to "IBM i"
But I cannot find method to create db link from "IBM i" to DB2 UDB.
In advanced, thank you for your support.
------------------------------
DuckHyun Yu
------------------------------