Get Object DDL
get_object_ddlRetrieve the SQL DDL that recreates a DB2 for i object such as a table, view, or procedure. Uses QSYS2.GENERATE_SQL and returns the statements without running them.
Instructions
Return the SQL DDL that recreates a database object, using QSYS2.GENERATE_SQL. Does not run the generated statements. Requires IBM i 7.3 or later.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"object": "<object>",
"type": "<type>"
},
"name": "get_object_ddl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Object type: TABLE, VIEW, INDEX, ALIAS, TRIGGER, FUNCTION, PROCEDURE, or SEQUENCE | |
| object | Yes | Object name | |
| schema | No | Schema (library) that contains the object. Uses the system's default schema if not provided. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ddl | No | ||
| type | No | ||
| error | No | ||
| object | No | ||
| schema | No | ||
| success | Yes |