Hi There,
Can we use a SQL with clause in an insert statement,
Something like
create table tem (l number)
insert into tem
(l)
(with
t0 as
(Select exp_amt as t0 from exp_main)
select t0 from t0)
The with statement in itself works fine, but it throws the following error with insert
Error at Command Line:8 Column:17
Error report:
SQL Error: ORA-32034: unsupported use of WITH clause
32034. 00000 - "unsupported use of WITH clause"
*Cause: Inproper use of WITH clause because one of the following two reasons
1. nesting of WITH clause within WITH clause not supported yet
2. For a set query, WITH clause can't be specified for a branch.
3. WITH clause can't sepecified within parentheses.
*Action: correct query and retry
The reason I am using this format is because, we are trying to generate sqls from Analytics and the queries are generally formed like this. So instead of modifying the big queries, I was hoping we were able to insert it.
Please advise
thanks
Sun
Edited by: ryansun on Aug 14, 2012 1:59 AM