logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Stauffer <jstau...@spscommerce.com>
Subject RE: Oracle.sql incorrect
Date Wed, 12 May 2004 13:00:20 GMT
The warning can probably now be removed also. :-)

------------------------------- Begin file
-- This SQL script creates the required tables by
org.apache.log4j.db.DBAppender and
-- org.apache.log4j.db.DBReceiver.
--
-- It is intended for Oracle databases.

--drop TRIGGER logging_event_id_seq_trig;
--drop SEQUENCE logging_event_id_seq;
--drop table logging_event_property;
--drop table logging_event_exception;
--drop table logging_event;

CREATE SEQUENCE logging_event_id_seq MINVALUE 1 START WITH 1;

CREATE TABLE logging_event 
  (
    sequence_number   NUMBER(20) NOT NULL,
    timestamp         NUMBER(20) NOT NULL,
    rendered_message  VARCHAR2(4000) NOT NULL,
    logger_name       VARCHAR2(254) NOT NULL,
    level_string      VARCHAR2(254) NOT NULL,
    ndc               VARCHAR2(4000),
    thread_name       VARCHAR2(254),
    reference_flag    NUMBER(5),
    id                INT PRIMARY KEY
  );

CREATE TRIGGER logging_event_id_seq_trig
  BEFORE INSERT ON logging_event
  FOR EACH ROW  
  BEGIN  
    SELECT logging_event_id_seq.NEXTVAL 
    INTO   :NEW.id 
    FROM   DUAL;  
  END logging_event_id_seq_trig;
/
CREATE TABLE logging_event_property
  (
    event_id	      INT NOT NULL,
    mapped_key        VARCHAR2(254) NOT NULL,
    mapped_value      VARCHAR2(254),
    PRIMARY KEY(event_id, mapped_key),
    FOREIGN KEY (event_id) REFERENCES logging_event(id)
  );
  
CREATE TABLE logging_event_exception
  (
    event_id         INT NOT NULL,
    i                NUMBER(5) NOT NULL,
    trace_line       VARCHAR2(254) NOT NULL,
    PRIMARY KEY(event_id, i),
    FOREIGN KEY (event_id) REFERENCES logging_event(id)
  );
  


------------------------------------End of file

James Stauffer


-----Original Message-----
From: Ceki Gülcü [mailto:ceki@qos.ch] 
Sent: Wednesday, May 12, 2004 7:56 AM
To: Log4J Developers List
Subject: RE: Oracle.sql incorrect



So what does the oracle.sql file look like now?

At 02:47 PM 5/12/2004, you wrote:

>It appears the only thing wrong with the trigger is that it needs "/" 
>on
>the line right after it ends.
>
>Also, for me it has been helpful to have the drop commands in the
>file.  Do we want to included them in a comment?
>--drop TRIGGER logging_event_id_seq_trig;
>--drop SEQUENCE logging_event_id_seq;
>--drop table logging_event_property;
>--drop table logging_event_exception;
>--drop table logging_event;
>
>James Stauffer
>-----Original Message-----
>From: James Stauffer
>[<mailto:jstauffe@spscommerce.com>mailto:jstauffe@spscommerce.com]
>Sent: Wednesday, May 12, 2004 7:33 AM
>To: 'Log4J Developers List'
>Subject: RE: Oracle.sql incorrect
>
>Ceki is correct INTEGER doesn't need to be changed to NUMBER(10).  Also 
>I
>think my trigger still isn't correct.  I'll check.
>
>James Stauffer

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

Mime
View raw message