Slash commands
Use IBM i-specific slash commands to re-use pre-defined prompts that automate repetitive tasks.
IBM Bob Premium Package for i extends Bob's built-in slash commands with a set of IBM i-specific slash commands. For a general introduction to how slash commands work and what the built-in ones are, see Slash Commands.
Type / in the chat to see all available commands, including the IBM i-specific ones described here.
/erd
The /erd command instructs Bob to generate a Mermaid style Entity Relationship Diagram (ERD) for a set of database tables on the connected IBM i.
| Property | Value |
|---|---|
| Command | /erd |
| Argument hint | [schema.table or library/file] |
| Available in | IBM i Developer, IBM i Database |
| Requires | Active IBM i connection |
What it does
Bob follows these steps:
Determine scope from the argument you provided or ask which schema/library to analyze if no argument is given.
Query QSYS2.SYSTABLES, QSYS2.SYSCOLUMNS, QSYS2.SYSCST, and QSYS2.SYSREFCST to gather table structure and relationships.
Build and render a Mermaid style Entity Relationship Diagram (ERD) with accurate Db2 for i data types, column markers (PK, FK, UQ), and cardinality notations.
Example usage
/erd
/erd MYLIB
/erd MYAPP.ORDERS
/erd MYPROJ/CUSTOMER/review
The /review command instructs Bob to perform a comprehensive review of an SQL statement against a pre-defined checklist for correctness, performance, security, and best practices.
| Property | Value |
|---|---|
| Command | /review |
| Argument hint | [SQL statement to review] |
| Available in | IBM i Database |
| Requires | Active IBM i connection |
What it does
Bob follows these steps:
Parse the SQL statement from the argument you provided or ask for one if no argument is given.
Evaluate the statement against a comprehensive review checklist:
- Correctness and simplification: Correctness concerns, redundant predicates, fragile constructs, nested subqueries, repeated expressions, and unnecessary joins
- Readability and supportability: Formatting, aliases, and comments on complex logic
- Qualification and naming: Table correlation names and ordinary versus delimited identifiers
- Best practices: Usage of built-in functions, CTEs, and parameter markers
- Security: SQL injection risks, excessive privilege, row permissions, and column masks
- Performance from SQL text: Non-sargable predicates, unnecessary scalar functions in predicates, and avoidable casts
- Statement-type-specific guidance: Specifics for DDL, DML, embedded SQL, and dynamic SQL
- Diagnostic and verification guidance: Visual Explain, plan cache, and index advice pointers
- Reusable logic: UDFs, stored procedures, and SQL
INCLUDEcandidates - Transaction isolation: Explicit
WITHclauses and isolation level consistency
Return the findings structured as:
- Summary: Brief overall assessment
- Confirmed Findings: Numbered list of issues each with a category, explanation, and suggested improvement
- Conditional Recommendations: Numbered list of suggestions that depend on metadata, workload, or runtime evidence
- Revised SQL: A revised SQL statement only when semantics can be preserved confidently; otherwise an illustrative rewrite with an explanation of what remains conditional
- Explanation of Changes: Concise description of each suggested change
Example usage
/review
/review SELECT * FROM ORDERS WHERE CUSTID = '12345'
/review SELECT A.ORDNO, B.CUSTNAME FROM ORDERS A JOIN CUSTOMER B ON A.CUSTID = B.CUSTID