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

Home -> Community -> Usenet -> c.d.o.server -> can you make this faster, please

can you make this faster, please

From: Paschal Mushubi <bs260_at_freenet.carleton.ca>
Date: 9 Jun 1999 22:24:53 GMT
Message-ID: <01beb2e0$adc2dd40$dd897586@wotrmushubi>


DECLARE
CURSOR c_customers is
SELECT rowid customer_rowid,

        customer_number,
        address

FROM NEW_TABLE
v_customers c_customers%ROWTYPE;
BEGIN
        OPEN c_customers;
        FETCH c_customers INTO v_customers;
        WHILE c_customers%FOUND LOOP
                BEGIN
                   SELECT  T1.address
                    INTO    v_customers.address
                    FROM    CUSTOMERS T1,
                           ADDRESES T2
                   WHERE   T1.customer_number =v_customers.customer_number
                   and     T1.cust_id = T2.cust_id;
                            EXCEPTION
                            WHEN NO_DATA_FOUND THEN
                               v_customers.address := null;

END;
        BEGIN
             UPDATE  NEW_TABLE
             SET     address = v_customers.address
             WHERE   rowid = v_customers.customer_rowid;
        END;
                v_customers.address := NULL;
        FETCH c_customers INTO v_customers;
        END LOOP;
        CLOSE c_customers;
        COMMIT;

END get_customer_address; Received on Wed Jun 09 1999 - 17:24:53 CDT

Original text of this message

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