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