Home › Learn IBM i › Db2 for i Guide
Db2 for i is built into IBM i, so every IBM i developer is also a database developer. This guide organizes the SQL and database articles on AS400Decoded from first queries to query optimization.
Prefer a guided order? Follow the SQL on IBM i on the IBM i Learning Paths page.
Getting Started with Db2 for i
- Db2 for IBM i Explained
- SQL on IBM i for Beginners
- DB2 for i: the database hiding in plain sight
- DB2 for i in 2026: IBM i’s Integrated Database, System Naming vs SQL Naming, Physical Files, the Query Optimiser, and How It Differs from Standalone Databases
Writing SQL
- Db2 for i MERGE Statement: INSERT, UPDATE & UPSERT
- DB2 for i CTEs and Recursive SQL: WITH Clause, Recursive Queries, BOM Explosion, and Organizational Hierarchy in 2026
- DB2 for i Window Functions: ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, FIRST_VALUE, LAST_VALUE with OVER and PARTITION BY on IBM i in 2026
SQL in RPG Programs
Stored Procedures, Functions, and Triggers
- DB2 for i SQL Stored Procedures and User-Defined Functions in 2026: CREATE PROCEDURE, Cursors, UDFs, and Reusable Business Logic in DB2
- DB2 for i Triggers in 2026: SQL and External Triggers, BEFORE and AFTER Timing, Audit Logging, and Calling RPG from a Trigger
JSON, XML, and HTTP from SQL
- DB2 for i JSON and XML Support in 2026: JSON_VALUE, JSON_TABLE, FOR JSON, XMLTABLE, and Building REST Responses in SQL
- IBM i HTTP Client from RPG: QSYS2 HTTP_GET, HTTP_POST, and Calling REST APIs with JSON in 2026
Transactions and Journaling
- IBM i Journaling and Commitment Control Explained
- IBM i Commitment Control and Transaction Management: STRCMTCTL, COMMIT, ROLLBACK, Savepoints, and Multi-File Updates in 2026
Query Performance
- DB2 for i Query Optimization: Visual Explain in ACS, SQE vs CQE, Index Design, Encoded Vector Indexes, STRDBMON, and Reading the SQL Plan Cache on IBM i in 2026
- DB2 for i Advanced SQL in 2026: SQE vs CQE, Index Advisor, Column Statistics, Materialized Query Tables, and Query Performance Patterns
Replication and AI Workloads
- DB2 for i Replication in 2026: Journal-Based CDC, Q-Replication, MIMIX, and Designing a Replication Strategy
- Vector Search and Embeddings on IBM i in 2026: Storing Vectors in DB2 for i, Cosine Similarity in SQL, and Semantic Search over IBM i Data
Planned Topics
These topics are on the writing plan for this guide:
- Creating tables, keys, and constraints with SQL DDL
- Joins on IBM i, with worked examples
- IBM i SQL services for everyday administration
Browse the Archive
See every post filed in the Db2 for i category, newest first.