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 -> stored procedure example(s)

stored procedure example(s)

From: Graeme Richardson <graeme_at_wave_nospam.co.nz>
Date: Fri, 23 Apr 2004 06:21:10 +1200
Message-ID: <c6914j$jo7$1@news.wave.co.nz>


Hi, I tried posting this request to an Oracle newbies list group without response (I think it's worded correctly). Please accept apologies for cross post.

I'm looking for or examples of stored procedures for Oracle RDB 7.0.5 I don't have access to manuals.

I want to execute an SQL Update statement on a table. 1) I would like to implement error handling (if possible) 2) I would like to wrap the SQL statement in a transaction; issuing a commit only on no error, and rollback otherwise. 3) I would like to print a report of all updated records.

I have this code (comments in braces):

CREATE MODULE fixImport LANGUAGE SQL
PROCEDURE parseNarrative (:CCTRBatch CHAR(6));   BEGIN     {Set up Transaction}
    SET TRANSACTION READ WRITE

        RESERVING cc_ma_job_masters FOR SHARED READ
        cc_tr_transaction FOR SHARED WRITE;

        {Execute SQL Update statement}
        UPDATE cc_tr_transaction SET cc_tr_narrative = {etc}

        ; {End of SQL Statement}

    COMMIT; {Transaction}

  END;
END MODULE; Thanks for your help, Graeme Received on Thu Apr 22 2004 - 13:21:10 CDT

Original text of this message

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