declare
    column_exists exception;
    pragma exception_init (column_exists , -01451);
begin
    execute immediate 'ALTER SESSION SET DDL_LOCK_TIMEOUT= 30';
    exception when column_exists then null;
end;
/
DECLARE
    object_exists EXCEPTION;
    pragma exception_init(object_exists, -00955);
BEGIN
    EXECUTE IMMEDIATE 'CREATE TABLE CONF_PRODUCTO_PARADA (
        CONF_PRODUCTO_PARADA_ID NUMBER(7,0) NOT NULL,
        CONFIGURACIONPRODUCTO_ID NUMBER(7,0) NOT NULL,
        PARADA_ID NUMBER(7,0) NOT NULL,
        USUARIO_ID NUMBER(7,0) NOT NULL,
        FECMODIF DATE NOT NULL,
        ACTIVO NUMBER(1,0) NOT NULL,
        CONSTRAINT CONF_PRODUCTO_PARADA_PK PRIMARY KEY (CONF_PRODUCTO_PARADA_ID),
        CONSTRAINT CONF_PROD_PARADA_CONF_PROD_FK FOREIGN KEY (CONFIGURACIONPRODUCTO_ID) REFERENCES CONFIGURACION_PRODUCTO(CONFIGURACIONPRODUCTO_ID),
        CONSTRAINT CONF_PRODUCTO_PARADA_FK FOREIGN KEY (PARADA_ID) REFERENCES PARADA(PARADA_ID),
        CONSTRAINT CONF_PROD_PARADA_USUARIO_FK FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID)
    )';
EXCEPTION 
    WHEN object_exists THEN NULL;
END;
/

DECLARE
    object_exists EXCEPTION;
    pragma exception_init(object_exists, -00955);
BEGIN
    EXECUTE IMMEDIATE 'CREATE SEQUENCE CONFIG_PRODUCTO_PARADA_SEQ INCREMENT BY 1 MINVALUE 0 NOCYCLE NOCACHE NOORDER'; 
EXCEPTION 
    WHEN object_exists THEN NULL;
END;