locked
unable to config the enterprise library exception handling for oracle RRS feed

  • Question

  • User-115257982 posted

    Hi

    unable to config the enterprise library exception handling for oracle

    any help?

     

    Thanks in advance :-)

    Wednesday, September 15, 2010 2:23 AM

All replies

  • User-115257982 posted

    problem comes with the Oracle procedures..

    any help?

     i am struggling from past three days

     

    CREATE TABLE LOG
    (
      LOGID             INTEGER,
      EVENTID           INTEGER,
      PRIORITY          INTEGER                     NOT NULL,
      SEVERITY          VARCHAR2(32 BYTE)           NOT NULL,
      TITLE             VARCHAR2(256 BYTE)          NOT NULL,
      TIMESTAMPD        DATE                        NOT NULL,
      MACHINENAME       VARCHAR2(32 BYTE)           NOT NULL,
      APPDOMAINNAME     VARCHAR2(512 BYTE)          NOT NULL,
      PROCESSID         VARCHAR2(256 BYTE)          NOT NULL,
      PROCESSNAME       VARCHAR2(512 BYTE)          NOT NULL,
      THREADNAME        VARCHAR2(512 BYTE),
      WIN32THREADID     VARCHAR2(128 BYTE),
      MESSAGE           VARCHAR2(1500 BYTE),
      FORMATTEDMESSAGE  LONG
    )
    /
    CREATE TABLE CATEGORYLOG
    (
      CATEGORYLOGID  INTEGER,
      CATEGORYID     INTEGER                        NOT NULL,
      LOGID          INTEGER                        NOT NULL
    )
    /
    
    CREATE TABLE CATEGORY
    (
      CATEGORYID    INTEGER,
      CATEGORYNAME  VARCHAR2(64 BYTE)               NOT NULL
    )
    /
    CREATE OR REPLACE PROCEDURE WriteErrorLog (
       ip_eventid            INTEGER,
       ip_priority           INTEGER,
       ip_severity           VARCHAR2,
       ip_title              VARCHAR2,
       ip_timestamp          DATE,
       ip_machinename        VARCHAR2,
       ip_appdomainname      VARCHAR2,
       ip_processid          VARCHAR2,
       ip_processname        VARCHAR2,
       ip_threadname         VARCHAR2,
       ip_win32threadid      VARCHAR2,
       ip_message            VARCHAR,
       ip_formattedmessage   LONG,
       ip_logid              INTEGER
    )
    AS
    lverrorcd   NUMBER         := 00;
       lverrmsg    VARCHAR2 (100) := 'WriteErrorLog';
    BEGIN
       INSERT INTO LOG
                   (logid,eventid, priority, severity, title,
                    timestampd, machinename, appdomainname,
                    processid, processname, threadname,
                    win32threadid, MESSAGE, formattedmessage
                   )
            VALUES (log_id.nextval,ip_eventid, ip_priority, ip_severity, ip_title,
                    ip_timestamp, ip_machinename, ip_appdomainname,
                    ip_processid, ip_processname, ip_threadname,
                    ip_win32threadid, ip_message, ip_formattedmessage
                   );
     COMMIT;
    END;
    /
    CREATE OR REPLACE PROCEDURE AddCategory                 --- 'GENER',1
                                                  (
       ip_categoryname   VARCHAR2,
       ip_logid          INT
    )
    AS
       lv_catid   NUMBER;
    BEGIN
       SELECT categoryid
         INTO lv_catid
         FROM CATEGORY
        WHERE categoryname = ip_categoryname;
    
       IF (lv_catid = 0)
       THEN
          
    	  INSERT INTO CATEGORY
                      (CATEGORYID,categoryname
                      )
               VALUES (CATEGORY_ID.NEXTVAL,ip_categoryname
                      );
       
       ELSE
          
    	  
    	  
    	  EXECUTE IMMEDIATE 'EXEC InsertCategoryLog (LV_CATID, ip_LogID)';
    
    	  
       END IF;
    END;
    /
    CREATE OR REPLACE PROCEDURE InsertCategoryLog (
       ip_categoryid   INT,
       ip_logid        INT
    )
    AS
       lv_catlogid   NUMBER;
    BEGIN
    -- DECLARE @CatLogID INT
       SELECT CATEGORYLOGID
         INTO lv_catlogid
         FROM categorylog
        WHERE categoryid = ip_categoryid AND logid = ip_logid;
    
       IF (lv_catlogid=0 )
       
       THEN
         
    	  INSERT INTO categorylog
                      (CATEGORYLOGID,categoryid, logid
                      )
               VALUES (categorylog_id.nextval, ip_categoryid, ip_logid
                      );
    --  RETURN @@IDENTITY
       ELSE
          DBMS_OUTPUT.put_line (lv_catlogid);
       END IF;
    END;
    /
    


     

     

    Wednesday, September 15, 2010 4:49 AM