cancel
Showing results for 
Search instead for 
Did you mean: 

how to use recursive sql syntax against DB2 version 8.01

Former Member
0 Kudos

When I try to use this recursive sql syntax in a

derived table

-


;WITH myCTE (CustID, Co) AS

(

SELECT CustomerID, CompanyName FROM Customers

)

SELECT CustID, Co FROM myCTE

-


I get an error :

Exception: DBD,[IBM][Cli Driver][db2] SQL0199N The use of the reserved word "AS" following "" is not valid Expected Tokens may include: "FULL LEFT INNER RIGHT". SQLSTATE =42601

If I use the same syntax in Toad against the same

DB2 no errors at all.

All the help is highly repreciated

thanks

Finn

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Finn,

is it possible that you have some non-printable characters like a certain type of carriage return or tab embedded in the SQL code that makes the error appear?

Thanks,

John

Answers (0)