Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Bulk updates in SQL
On Jan 26, 3:15 pm, DA Morgan <damor..._at_psoug.org> wrote:
Why not use the technology already in Oracle specifically for
> that purpose?
>
> INSERT ALL
> INTO ap_cust VALUES (customer_id, program_id, delivered_date)
> INTO ap_orders VALUES (order_date, program_id)
> SELECT program_id, delivered_date, customer_id, order_date
> FROM airplanes;
>
> or
>
> INSERT ALL
> WHEN (deptno=10) THEN
> INTO emp_10 (empno,ename,job,mgr,sal,deptno)
> VALUES (empno,ename,job,mgr,sal,deptno)
> WHEN (deptno=20) THEN
> INTO emp_20 (empno,ename,job,mgr,sal,deptno)
> VALUES (empno,ename,job,mgr,sal,deptno)
> WHEN (deptno<=30) THEN
> INTO emp_30 (empno,ename,job,mgr,sal,deptno)
> VALUES (empno,ename,job,mgr,sal,deptno)
> ELSE
> INTO leftover (empno,ename,job,mgr,sal,deptno)
> VALUES (empno,ename,job,mgr,sal,deptno)
> SELECT * FROM emp;
>
> It is far more flexible.
Thanks! That's very interesting, I'll look into that some time. But now, do you know of an UPDATE version also, which is what I was originally posting about?
Dean Received on Fri Jan 26 2007 - 14:39:33 CST
![]() |
![]() |