cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use Begin Parallel Execution to insert into the same table

former_member565459
Participant

Can we use Begin Parallel Execution to insert into the same table where I'm passing a different parameter in the where condition everytime.

pfefferf
Active Contributor
0 Kudos

An insert does not have a where condition. So what do you require in detail (and what is not answered by the official help)?

former_member565459
Participant
0 Kudos
florian.pfeffer

I have a procedure which stores the output of one query in a variable say

t_rst = select columns 
From big_table left outer
Small_table
Where
Some conditions;

And then

 insert into table A
Select * from t_rst;

This takes a lot of time.

I want to implement something like.

I want to range partition the big_table on a column name region.

And then parallely execute

Insert into table A
Select * from :t_rst1 (which contains say partition where region =1)
Insert into table A
Select * from :t_rst2 (which contains say partition where region =2)
Insert into table A
Select * from :t_rst3 (which contains say partition where region =3)

So this may parallely insert the data in my Table A.

This is just a hypothetical example. I don't know if this is feasible or not.

Any guidance on the same ?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

No that is not possible until know. Please check the limitations for explicit parallel executions in the official documentation.

... Updating the same table in different statements is not allowed ...

former_member565459
Participant
0 Kudos

Thankyou for your quick help.

I have a few more doubts:

Updating the same table includes insert statement too ?

What if we are inserting into the different partitions of the same table ?

(Suppose my Table A is also partitioned)

Is it possible to insert into a particular partition ?

Something like insert into Table A (partition 1)

Answers (0)