Running a query that contains the 'With UR' statement in Toad for DB2 and it runs and will show an explain plan. However, sending the same query to the Optimizer for DB2 and performing a SQL Rewrite, the following error occurs:
The Parser did not identify the text as a valid SQL Statement.
[IBM][CLI Driver][DB2/AIX64] SQL0206N "V.VECTOR_ID" is not valid in the context where it is used. SQLSTATE=42703
WORKAROUND:
Remove all instances of the 'With UR' from the query and re-test the SQL Rewrite.
STATUS:
Waiting for a fix in a future version of SQL Optimizer for DB2.