line tool. SQL Commands are executed on the server, while the command line commands are executed on
the client by the native library. So, in the command line tool you can write a script that executes both SQL
commands and client commands. But ADS only sends SQL commands to the server. If you execute RUNSTATS
in ADS, it will send it to the server to execute, but since RUNSTATS is a client side command, the DB2
server doesn’t understand it and returns an error.
Studio ? I can execute these commands through the DB2 CLP
Response
ariq Rahiman over 9 years ago
To execute DB2 UDB Admin Functions to work in Aqua Data Studio, you can use the SYSPROC.ADMIN_CMD procedure which
will work through most of the JDBC drivers.
1. Open a query window in Aqua Data Studio to your DB2 Server
2. Use the ADMIN_CMD procedure CALL SYSPROC.ADMIN_CMD()
3. Some sample IBM DB2 UDB Admin commands which run in Aqua Data Studio Query Analyzer are given below:
To describe a table use the command:
CALL SYSPROC.ADMIN_CMD(‘describe table DCMS.acct_activity’)
To execute DB2 RUNSTATS on a table use the command:
CALL SYSPROC.ADMIN_CMD(‘RUNSTATS ON table DCMS.acct_activity’)
To run a DB2 Export command use:
CALL SYSPROC.ADMIN_CMD(‘Export To c:\acct.del OF DEL SELECT * FROM DCMS.”acct_activity” ‘)
Note: For EXPORT command to work you need specify a directory path of the Server. Export will also work with a
file url to a shared drive on another device.