Problem executing recursive query from Sql Assistant

Database

Problem executing recursive query from Sql Assistant

Hi

When i execute the below mentionet sql from BTEQ it works fine however when it is executed from Sql Assistant it gives the error "3706: Syntax error: Expected something between the begenning of the request and the 'with' keyword".

Please assist.

WITH RECURSIVE All_Trips
(Origin,
Destination,
Cost,
Depth) AS
(
SELECT Origin, Destination, Cost, 0
FROM Flights
WHERE Origin = 'LAX'
UNION ALL
SELECT All_Trips.Origin,
Flights.Destination,
All_Trips.Cost + Flights.cost,
All_Trips.Depth + 1
FROM All_Trips INNER JOIN Flights
ON All_Trips.Destination = Flights.Origin
AND All_Trips.Depth < 3
)
SELECT *
FROM All_Trips;

Regards