I'm really at a loss why I can't get this recursive CTE to work in HANA. We're on HANA 2 so from what I understand it should be supported if I put it in a procedure as SQLSCRIPT. We don't want to use the built in hierarchy functions since we're trying to not use proprietary solutions where possible.
It's not recognizing the nested (INNER JOIN) portion of the CTE. I've tried everything and it says it doesn't find it in my personal schema which is telling me it's interpreting it as a table.
Error:
[Location_In_Repository] Dependent object not found: SqlScript; USERSCHEMA.USER_HIER: symbol not found
BEGIN
WITH USER_HIER AS (
SELECT USER_ID, MANAGER_ID
FROM HR.DIM_USER_V
UNION ALL
SELECT hier.USER_ID, hier.MANAGER_ID
FROM HR.DIM_USER_V hier
INNER JOIN USER_HIER ON USER_HIER.USER_ID = hier.MANAGER_ID)
SELECT *
FROM USER_HIER;
END