By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,611 Members | 2,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,611 IT Pros & Developers. It's quick & easy.

explain - invalid token

P: n/a
Hi,
I'm new in db2, I'm trying to execute EXPLAIN command on some queries
but i have error like: [Error Code: -104, SQL State: 42601]
[SQL0104]
And message similar to: Token EXPLAIN is not valid, valid tokens ( END
GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER.
I've created tables explain_*
How can I start to find solution? Is it possible that my db2 doesn't
support explain?

greetings

Mar 31 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ka******@gmail.com wrote:
Hi,
I'm new in db2, I'm trying to execute EXPLAIN command on some queries
but i have error like: [Error Code: -104, SQL State: 42601]
[SQL0104]
And message similar to: Token EXPLAIN is not valid, valid tokens ( END
GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER.
I've created tables explain_*
How can I start to find solution? Is it possible that my db2 doesn't
support explain?

greetings
Not sure what you mean by EXPLAIN. You could either use an explain
utility from the control center (dont know where that might be though).
If I remember correctlt you mark a query and rightclick with the mouse
and choose explain. Or you could run explain as in:

db2 "explain plan for select ...."

and then format the output with

db2exfmt -d <db....

Which version of explaing are you having problems with?

Mar 31 '07 #2

P: n/a
On 31 Mar, 12:46, Lennart <erik.lennart.jons...@gmail.comwrote:
kabot...@gmail.com wrote:
I'm new in db2, I'm trying to execute EXPLAIN command on some queries
but i have error like: [Error Code: -104, SQL State: 42601]
[SQL0104]
And message similar to: Token EXPLAIN is not valid, valid tokens ( END
GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER.
I've created tables explain_*

Not sure what you mean by EXPLAIN. You could either use an explain
utility from the control center (dont know where that might be though).
If I remember correctlt you mark a query and rightclick with the mouse
and choose explain. Or you could run explain as in:

db2 "explain plan for select ...."

and then format the output with

db2exfmt -d <db....

Which version of explaing are you having problems with?
I'm executing following query: "explain plan for select * from
tabname" from DbVisualizer precisely (db client on winxp), and all i
got is mentioned error.
btw. thanks for interest, i spent many hours trying to optimize one
query and i hope that created plan would be helpful

Mar 31 '07 #3

P: n/a
ka******@gmail.com wrote:
[...]
I'm executing following query: "explain plan for select * from
tabname" from DbVisualizer precisely (db client on winxp), and all i
got is mentioned error.
btw. thanks for interest, i spent many hours trying to optimize one
query and i hope that created plan would be helpful
I see, well I have no knowledge on DbVisualizer but should you really
put "explain pln for " in your query? I would have guessed that you
execute the query: select * from T, and then open "explain part" of the
DbVisualizer.

Judging from what drivers suggested at DbVisualizer homepage, they talk
jdbc with the database and as far as I know, explain plan is not part of
what can be sent through jdbc.
/Lennart

Mar 31 '07 #4

P: n/a
On 31 Mar, 13:16, Lennart <erik.lennart.jons...@gmail.comwrote:
kabot...@gmail.com wrote:

[...]
I'm executing following query: "explain plan for select * from
tabname" from DbVisualizer precisely (db client on winxp), and all i
got is mentioned error.

Judging from what drivers suggested at DbVisualizer homepage, they talk
jdbc with the database and as far as I know, explain plan is not part of
what can be sent through jdbc.
Maybe you're right but i didn't find any article about explain in
http://publib.boulder.ibm.com/infoce...v5r3/index.jsp so
maybe i have to solve my problem without plan.
btw. join with 2 tables on about 1mln and 2mln records on indexed cols
shouldn't take 20 secs right? i 'm start thinking i do this better in
mysql :) (my everyday db)
greetz and thanks

Mar 31 '07 #5

P: n/a
ka******@gmail.com wrote:
[...]
Maybe you're right but i didn't find any article about explain in
http://publib.boulder.ibm.com/infoce...v5r3/index.jsp so
maybe i have to solve my problem without plan.
Are you using the free version of DbVisualizer? I got the impression
that you have to pay a licence fee to get access to the explain facility
in DbVisualizer. Dont you have a db2 control center to use instead (I
dont know anything about v5r3 either)
btw. join with 2 tables on about 1mln and 2mln records on indexed cols
shouldn't take 20 secs right? i 'm start thinking i do this better in
mysql :) (my everyday db)
Perhaps mysql have improved in later versions. Earlier, one of the most
common question on usenet regarding mysql was: how do I do this in
mysql, and one of the most common answers: you cant :-)
greetz and thanks
Mar 31 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.