CREATE TABLE LOGSOLCOMPRA (
    NRSOLICMP		  VARCHAR2(20) NOT NULL,
    CDFILIEMIT 		  VARCHAR2(4),
    CDFILIRECE 		  VARCHAR2(4) NOT NULL,
    DTSOLCMP 		  DATE,
    DTENTRSAID 		  DATE,
    DTLOG 		      DATE DEFAULT SYSDATE,
    IDSTATUS 		  VARCHAR2(1) NOT NULL,
    NRNOTAFISC 		  VARCHAR2(20),
    MENSAGEM 		  VARCHAR2(3000),
	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',
		CONSTRAINT CKC_IDATIVO_LOGSOLCOMPRA CHECK (IDATIVO IN ('S','N'))
)
/