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

Home -> Community -> Usenet -> c.d.o.tools -> Help : simple PL/SQL question

Help : simple PL/SQL question

From: Sebastien FERRANDEZ <sferrandez_at_wineandco.com>
Date: 2000/05/16
Message-ID: <39216464.CB8E999A@wineandco.com>#1/1

DECLARE

        CURSOR my_cursor IS SELECT PRICE,PROD_ID FROM PRODUCT;
        I_IDENTIF VARCHAR2(80); // exactly the same data type as PROD_ID

        I_PRIX NUMBER(18,2);        // exactly the same data type as
PRICE BEGIN         OPEN my_cursor;
        LOOP
                FETCH my_cursor INTO I_PRIX,I_IDENTIF;
                UPDATE PRODUCT SET PRICE_ENTIER=(I_PRIX*100) WHERE
PROD_ID='I_IDENTIF';
            EXIT WHEN (my_cursor%ROWCOUNT > 666) OR (my_cursor%NOTFOUND)

;
            COMMIT;
        END LOOP;

        CLOSE my_cursor;

END; I get "PL/SQL procedure successfully completed." as a result of executing this script.
But nothing (PRICE_ENTIER) is updated in the PRODUCT table...I've been spending time looking at this query and I can't see the error... I_IDENTIF (which is supposedly updating my ID field) is of VARCHAR type (sounds very strange but I didn't do the database schema myself). PRICE_ENTIER is a NUMBER(38).
In fact, through the script, I'm converting values from NUMBER(18,2) type to NUMBER(38), to get rid of my decimals... Received on Tue May 16 2000 - 00:00:00 CDT

Original text of this message

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