The following SQL structure is eliciting an error on unbalanced parenthesis that is not the case according to Toad and my editor. This construct was migrated from SAP IQ. If there is a simple resolution it will prevent a rewrite of a very complex query as evidenced by the nesting of the selects.
Select 1 as depth, L2.name
from (Select 2 as depth, L3.name
from (Select 3 as depth, L4.name
from (Select 4 as depth, 'walt' as name
from sys.dual
where 1=1
) as L4
) as L3
) as L2
where 1 = 1
;
Error at line 7
ORA-00907: missing right parenthesis