100 Tech Tips, #99 How to run REORG command from a CLI application?
MaryKKassey 2700055CKK Visits (2291)
How to run REORG table command from a CLI application against a DB2 database server?
REORG command is supported by command line processor, you cannot use the REORG command directly from a CLI application. In order to run REORG from a CLI application, you will have to use ADMIN_CMD stored procedure.
CALL SYSPROC.ADMIN_CMD ('REORG TABLE test')
The same REORG command when issued from the command line executes successfully.
db2 "reorg table test
DB20000I The REORG command completed succ