Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Bulk updates in SQL

Re: Bulk updates in SQL

From: dean <deanbrown3d_at_yahoo.com>
Date: 26 Jan 2007 12:39:33 -0800
Message-ID: <1169843973.014116.127120@k78g2000cwa.googlegroups.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US