Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-29-2008, 08:26 PM
Michel Esber
 
Posts: n/a
Default CLI Trace - Syntax Error

Hello,

DB2 LUW v8 FP15


I am running a simple 'runstats on table session.temp_MID_1 and
indexes all' and it fails with

[04/29/2008 13:25:49.902600] SQLAllocStmt( phStmt=4:2 )
[04/29/2008 13:25:49.902707] <--- SQL_SUCCESS Time elapsed -
+6.190000E-004 seconds

[04/29/2008 13:25:49.903030] SQLExecDirectW( hStmt=4:2,
pszSqlStr="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL",
cbSqlStr=52 )
[04/29/2008 13:25:49.903327] ---> Time elapsed - +3.230000E-004
seconds
[04/29/2008 13:25:49.903457] ( StmtOut="RUNSTATS ON TABLE
SESSION.TEMP_MID_1 AND INDEXES ALL" )
[04/29/2008 13:25:49.903583]
[04/29/2008 13:25:49.903664] ( Package="SYSSH100 ",
Section=65 )
[04/29/2008 13:25:49.903813]
sqlccsend( Handle - 2010514272 )
sqlccsend( ulBytes - 169 )
sqlccsend( ) rc - 0, time elasped - +4.500000E-005
sqlccrecv( )
sqlccrecv( ulBytes - 213 ) - rc - 0, time elapsed - +1.919000E-003
[04/29/2008 13:25:49.906177] ( COMMIT REPLY RECEIVED=1 )
[04/29/2008 13:25:49.906634]

[04/29/2008 13:25:49.906748] SQLExecDirectW( )
[04/29/2008 13:25:49.906826] <--- SQL_ERROR Time elapsed -
+3.796000E-003 seconds

[04/29/2008 13:25:49.901761] SQLFreeStmt( )
[04/29/2008 13:25:49.901826] <--- SQL_SUCCESS Time elapsed -
+5.340000E-004 seconds

[04/29/2008 13:25:49.902088] SQLAllocStmt( hDbc=0:4,
phStmt=&a45fedc4 )
[04/29/2008 13:25:49.902325] ---> Time elapsed - +2.620000E-004
seconds
[04/29/2008 13:25:49.902417] ( Re-using Cached Statement Structure=1 )
[04/29/2008 13:25:49.902529]

[04/29/2008 13:25:49.902600] SQLAllocStmt( phStmt=4:2 )
[04/29/2008 13:25:49.902707] <--- SQL_SUCCESS Time elapsed -
+6.190000E-004 seconds

[04/29/2008 13:25:49.903030] SQLExecDirectW( hStmt=4:2,
pszSqlStr="RUNSTATS ON TABLE SESSION.TEMP_MID_1 AND INDEXES ALL",
cbSqlStr=52 )
[04/29/2008 13:25:49.903327] ---> Time elapsed - +3.230000E-004
seconds
[04/29/2008 13:25:49.903457] ( StmtOut="RUNSTATS ON TABLE
SESSION.TEMP_MID_1 AND INDEXES ALL" )
[04/29/2008 13:25:49.903583]
[04/29/2008 13:25:49.903664] ( Package="SYSSH100 ",
Section=65 )
[04/29/2008 13:25:49.903813]
sqlccsend( Handle - 2010514272 )
sqlccsend( ulBytes - 169 )
sqlccsend( ) rc - 0, time elasped - +4.500000E-005
sqlccrecv( )
sqlccrecv( ulBytes - 213 ) - rc - 0, time elapsed - +1.919000E-003
[04/29/2008 13:25:49.906177] ( COMMIT REPLY RECEIVED=1 )
[04/29/2008 13:25:49.906634]

[04/29/2008 13:25:49.906748] SQLExecDirectW( )
[04/29/2008 13:25:49.906826] <--- SQL_ERROR Time elapsed -
+3.796000E-003 seconds

[04/29/2008 13:25:49.906970] SQLGetSqlca( hEnv=0:0, hDbc=0:0,
hStmt=4:2, pSqlcaOut=&081c92a8 )
[04/29/2008 13:25:49.907233] ---> Time elapsed - +1.440000E-004
seconds

[04/29/2008 13:25:49.907321] SQLGetSqlca( )
[04/29/2008 13:25:49.907393] <--- SQL_SUCCESS Time elapsed -
+4.230000E-004 seconds

[04/29/2008 13:25:49.907486]
SQLGetDiagFieldW( fHandleType=SQL_HANDLE_STMT, hHandle=4:2,
iRecNumber=1, fDiagIdentifier=Unknown value 2467, pDiagInfo=&a45fe47c,
cbDiagInfoMax=140, pcbDiagInfo=&a45fe478 )
[04/29/2008 13:25:49.907843] ---> Time elapsed - +9.300000E-005
seconds

[04/29/2008 13:25:49.907956] SQLGetDiagFieldW( pDiagInfo=5570642,
pcbDiagInfo=140 )
[04/29/2008 13:25:49.908114] <--- SQL_SUCCESS_WITH_INFO Time
elapsed - +6.280000E-004 seconds

[04/29/2008 13:25:49.908218]
SQLGetDiagFieldW( fHandleType=SQL_HANDLE_STMT, hHandle=4:2,
iRecNumber=1, fDiagIdentifier=Unknown value 2461, pDiagInfo=&a45fe474,
cbDiagInfoMax=4, pcbDiagInfo=&a45fe478 )
[04/29/2008 13:25:49.908577] ---> Time elapsed - +1.040000E-004
seconds

[04/29/2008 13:25:49.908658] SQLGetDiagFieldW( pDiagInfo=0,
pcbDiagInfo=0 )
[04/29/2008 13:25:49.908807] <--- SQL_SUCCESS Time elapsed -
+5.890000E-004 seconds

[04/29/2008 13:25:49.908908] SQLErrorW( hEnv=0:0, hDbc=0:0, hStmt=4:2,
pszSqlState=&a45fed14, pfNativeError=&a45fed10, pszErrorMsg=&a45fe50c,
cbErrorMsgMax=1024, pcbErrorMsg=&a45fe508 )
[04/29/2008 13:25:49.909343] ---> Time elapsed - +1.010000E-004
seconds
[04/29/2008 13:25:49.909565] ( iRowNumber=-1, iColumnNumber=-2 )
[04/29/2008 13:25:49.909761]

[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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 08:26 PM
Dave Hughes
 
Posts: n/a
Default Re: CLI Trace - Syntax Error

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 IMPORT, LOAD, EXPORT, etc.
directly via ODBC. However, the ADMIN_CMD stored procedure in v8 does
support 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/infoce...om.ibm.db2.udb
..doc/admin/r0012547.htm for details of ADMIN_CMD under v8.


Cheers,

Dave.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:00 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145