P. 1
Advanced Techniques

Advanced Techniques

|Views: 45|Likes:
Published by Sriharsha Majjiga

More info:

Published by: Sriharsha Majjiga on Jan 21, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

11/12/2011

pdf

text

original

Don't forget that ROLLBACK in the exception section!

logger.sp

log81.pkg

log81*.tst

CREATE OR REPLACE PACKAGE BODY log
IS

PROCEDURE putline (
code_in IN INTEGER, text_in IN VARCHAR2
)

IS

PRAGMA AUTONOMOUS_TRANSACTION;

BEGIN

INSERT INTO logtab
VALUES (code_in, text_in,
SYSDATE, USER, SYSDATE, USER,
rec.machine, rec.program

);

COMMIT;
EXCEPTION WHEN OTHERS THEN ROLLBACK;
END;

END;

While we're at it, let's

add some session

information.

Avoid inter-

dependencies with

the main transaction.

retry.pkg

retry.tst

PL/SQL Advanced Techniques -page 202

1/21/2011Copyright 2001 Steven Feuerstein

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->