CREATE TABLE INTEGRACAOLJCX (
    CDINTEGRACAO      VARCHAR2(3 BYTE)   NOT NULL,
    CDFILIAL          VARCHAR2(4 BYTE)   NOT NULL,
    CDLOJA            VARCHAR2(10 BYTE)  NOT NULL,
    CDCAIXA           VARCHAR2(3 BYTE)   NOT NULL,
    CDLOJAINT         VARCHAR2(10 BYTE)  ,
    CDCAIXAINT        VARCHAR2(3 BYTE)   ,
    NRORG             NUMBER 	      DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
    IDATIVO           VARCHAR2(1)     DEFAULT 'S'					NOT NULL,
    DTINCLUSAO        DATE            DEFAULT SYSDATE,
    DTULTATU          DATE            DEFAULT SYSDATE,
    NRORGINCLUSAO     NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERINCLUSAO    VARCHAR2(12)    DEFAULT '1' 					NULL,
    NRORGULTATU       NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERULTATU      VARCHAR2(12)    DEFAULT '1'
)
/
ALTER TABLE INTEGRACAOLJCX ADD CONSTRAINT CKC_IDATIVO_INTEGRACAOLJCX CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE INTEGRACAOLJCX ADD CONSTRAINT PK_INTEGRACAOLJCX PRIMARY KEY ("CDINTEGRACAO", "CDFILIAL", "CDLOJA", "CDCAIXA")
/