One thing I just want to add is dont expect any of the magic diagrams to draw pretty pictures if its defined by DDS.
In my own experience all these diagrams only work accurately if they are defined by the database constructs which people normally assume are there and there might be a mixture of the two DDS vs DDL Constructs around on some installations that attempted database migration.
If that is the case which you might find yourself in then these tools are the ones that normally will assist in those diagrams :
https://xcasefori.com/
https://freschesolutions.com/products/x-analysis-suite/
Hope it helps.
------------------------------
Marius le Roux theIBMiGuy
Owner , IBM i Consultant & Technology Strategist
MLR Consulting
------------------------------
Original Message:
Sent: Mon April 21, 2025 06:29 PM
From: Daniel Jose Lema Guanziroli
Subject: SQL Query for DB2400
Adding to what @Satid said, you can also use an external Entity Relationship Modelling software such as the very popular Erwin Data Modeler, that is able to make a complete (or partial if you wish) reverse engineering over your DB2 for IBM i database.
------------------------------
Daniel Jose Lema Guanziroli
Original Message:
Sent: Mon April 21, 2025 01:14 AM
From: Satid S
Subject: SQL Query for DB2400
Dear Jerry
There is no single query that does what you asked about. But you can write multiple SQL statements that are bundled into a single "compound" statement (encapsulated in BEGIN and END) that run as one.
Your question reminds me of a GUI tool in the old IBM i Navigator tool that came with the old IBM i Access For Windows. This tool is called DB Navigator and you can invoke it at the entire Database or Schema level of IBM i Navigator. This tool makes queries to Db2i catalog views and presents a graphical "network map" of the DB objects and their relationship (indicted by lines that link nodes). You can explore each objects in the network map that looks like the sample below. Somehow, this tool was abandoned from IBM i Access Client Solutions.


------------------------------
Satid S
Original Message:
Sent: Fri April 18, 2025 12:52 PM
From: jerry ven
Subject: SQL Query for DB2400
Hi,
Is there an SQL query that can be used to fetch and extract existing DB2 iSeries (IBM i) schema details - including table structures, data types, constraints, primary/foreign key relationships, and indexes?
Thanks...