Discussion:
explain - invalid token
(too old to reply)
k***@gmail.com
2007-03-31 10:07:11 UTC
Permalink
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
Lennart
2007-03-31 10:46:57 UTC
Permalink
Post by k***@gmail.com
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?
k***@gmail.com
2007-03-31 11:01:16 UTC
Permalink
Post by Lennart
Post by k***@gmail.com
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
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
Lennart
2007-03-31 11:16:27 UTC
Permalink
***@gmail.com wrote:
[...]
Post by k***@gmail.com
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
k***@gmail.com
2007-03-31 11:28:02 UTC
Permalink
Post by Lennart
[...]
Post by k***@gmail.com
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/infocenter/iseries/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
Lennart
2007-03-31 15:13:06 UTC
Permalink
***@gmail.com wrote:
[...]
Post by k***@gmail.com
Maybe you're right but i didn't find any article about explain in
http://publib.boulder.ibm.com/infocenter/iseries/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)
Post by k***@gmail.com
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 :-)
Post by k***@gmail.com
greetz and thanks
Loading...