Michel Esber wrote:
> Hello,
>
> DB2 LUW v8 FP15
>
>
> I am running a simple 'runstats on table session.temp_MID_1 and
> indexes all' and it fails with
>
[snip]
> [04/29/2008 13:25:49.909835] SQLErrorW( pszSqlState="42601",
> pfNativeError=-104, pszErrorMsg="[IBM][CLI Driver][DB2/LINUX]
> SQL0104N An unexpected token "RUNSTATS ON TABLE SESSION.TEM" was
> found following "BEGIN-OF-STATEMENT". Expected tokens may include:
> "<collect_stats_start>". SQLSTATE=42601
> ", pcbErrorMsg=205 )
> [04/29/2008 13:25:49.910104] <--- SQL_SUCCESS Time elapsed -
> +1.196000E-003 seconds
>
>
>
> ? It couldnīt be more simple than 'runstats on table T and indexes
> all'. How do I find where is the syntax error ?
The problem is that RUNSTATS is a CLP command, not an SQL statement.
Therefore you can't (directly) execute it via an interface like ODBC
(or JDBC, etc), just as you can't use IM****T, LOAD, EX****T, etc.
directly via ODBC. However, the ADMIN_CMD stored procedure in v8 does
sup****t RUNSTATS, so you should be able to execute it via something
like:
CALL ADMIN_CMD('RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL')
See
http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb
..doc/admin/r0012547.htm for details of ADMIN_CMD under v8.
Cheers,
Dave.


|