The Oracle syntax is DELETE FROM (query)
. The query can be a SELECT
with subquery factoring:
delete from (
with to_delete as (
select * from a
)
select * from to_delete
);
The above query works in 11gR2
but fails with ORA-01732
(non-updateable view) on an old 9iR2
.
Thanks Balazs papp ,
your answer was right 100% , i have used the following code :
EXECUTE IMMEDIATE 'INSERT INTO '|| CUR_MONTH ||' (
MT_ID ,
CL_ID ,
OP_ID ,
MT_PORT ,
MT_COST_TAG ,
MT_MSISDN ,
MT_TYPE_ID ,
MT_MSG ,
MT_RECEIVED_TIME ,
MT_PROCESSED ,
MT_STATUS ,
MT_DELIVERED ,
MT_DELIVERED_DETAILED ,
MT_DR_IS_EXPIRED ,
MT_IP ,
MT_RESPONSE_DESC
)
VALUES (
:b1,:b2,:b3,:b4,:b5,:b6,:b7,:b8,:b9,:b10,:b11,:b12,:b13,:b14,:b15,:b16
)'
USING
I.MT_ID ,
I.CL_ID ,
I.OP_ID ,
I.MT_PORT ,
I.MT_COST_TAG ,
I.MT_MSISDN ,
I.MT_TYPE_ID ,
I.MT_MSG ,
I.MT_RECEIVED_TIME ,
I.MT_PROCESSED ,
I.MT_STATUS ,
I.MT_DELIVERED ,
I.MT_DELIVERED_DETAILED ,
I.MT_DR_IS_EXPIRED ,
I.MT_IP ,
I.MT_RESPONSE_DESC
;
Best Answer
Only if you prefix the asterisk with the table name:
Which limits it's use to tables not joined with the
using
syntax: