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

Home -> Community -> Mailing Lists -> Oracle-L -> Standalone Function

Standalone Function

From: Feng, Jun <jfeng_at_netsol.com>
Date: Thu, 4 May 2000 17:05:16 -0400
Message-Id: <10487.104983@fatcity.com>


Hi,

I have a standalone function created as following:

CREATE OR REPLACE FUNCTION Canceltest(aExternalReference CHAR)

          RETURN NUMBER          AS     vProductId TEST.productId%TYPE;
     vProductRowId ROWID;
     vAmount TEST.Amount%TYPE;
          BEGIN
                SELECT RowId , amount    
                INTO vProductRowId, vAmount
              FROM TEST
              WHERE ExternalReference = aExternalReference;
        IF (vAmount > 30) THEN
              UPDATE TEST
            SET  Amount = 999
              WHERE RowId = vProductRowId;
        END IF;
              RETURN (1);
       EXCEPTION     WHEN OTHERS THEN      RETURN (-1);
          END Canceltest;

/

The function was created without error, but when I tried to use it I had following error:

SQL> select canceltest('WN.D.18065824') from dual; select canceltest('WN.D.18065824') from dual

       *
ERROR at line 1:
ORA-06571: Function CANCELTEST does not guarantee not to update database

Please help me to fix this. Received on Thu May 04 2000 - 16:05:16 CDT

Original text of this message

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