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

Visual Explain Error (SQL0104N) on Query Rewrite

P: 1
Hi,
I am using DB2 V9.1.300.257 on Windows. When I try to get the visual explain plan for a query from the command editor, it gives the following error:

[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "WITH SNAPSHOT" was found following "LAIN PLAN SELECTION ". Expected tokens may include: "FOR". SQLSTATE=42601


After some struggle, I figured out that this seems to happen when the optimizer is re-writing the base query to use an MQT. I confirmed this by checking the plan from db2exfmt. If I drop the MQT (and make NO other changes), the visual plan is generated without any problems. Is this a known bug or is there a workaround?

In any case, I thought it is worth posting here in case someone else faces the same error.

Regards,
Ramakrishna
Oct 9 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.