--order 502753 (analysis changed)

      /*
      ACTION is CREATE Table PACKINGNOTELINECPL
      */

CREATE TABLE PACKINGNOTELINECPL (
       PACKINGNOTELINE_ID   NUMBER NOT NULL,
       STANDARDDELIVERYLINE_ID NUMBER NOT NULL,
       SYSTEMUSER_ID        NUMBER NOT NULL,
       TIMESTAMP            DATE NOT NULL
);

CREATE SEQUENCE SEQ_PACKINGNOTELINECPL
START WITH 1
INCREMENT BY 1;

CREATE INDEX XIF1PACKINGNOTELINECPL ON PACKINGNOTELINECPL
(
       PACKINGNOTELINE_ID             ASC
);

CREATE INDEX XIF2PACKINGNOTELINECPL ON PACKINGNOTELINECPL
(
       STANDARDDELIVERYLINE_ID        ASC
);


ALTER TABLE PACKINGNOTELINECPL
       ADD  ( CONSTRAINT XPKPACKINGNOTELINECPL PRIMARY KEY (
              PACKINGNOTELINE_ID, STANDARDDELIVERYLINE_ID) ) ;


ALTER TABLE PACKINGNOTELINECPL
       ADD  ( CONSTRAINT PACKINGNOTELINECPL_STANDARDDEL
              FOREIGN KEY (STANDARDDELIVERYLINE_ID)
                             REFERENCES STANDARDDELIVERYLINE
                             ON DELETE CASCADE ) ;


ALTER TABLE PACKINGNOTELINECPL
       ADD  ( CONSTRAINT PACKINGNOTELINECPL_PACKINGNOTE
              FOREIGN KEY (PACKINGNOTELINE_ID)
                             REFERENCES PACKINGNOTELINE
                             ON DELETE CASCADE ) ;



