CREATE TABLE ULTIMACOTACAO (
    NRULTIMACOTACAO   NUMBER,
    CDREGIAO          VARCHAR2(03), 
    CDFORNECED        VARCHAR2(21),  
    CDPRODUTO         VARCHAR2(10), 
    CDMARCA           VARCHAR2(05),
    VRPRECOITM        FLOAT(126),
	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_ULTIMACOTACAO CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_ULTIMACOTACAO PRIMARY KEY (NRULTIMACOTACAO)
)
/

CREATE SEQUENCE SEQ_ULTIMACOTACAO INCREMENT BY 1 MINVALUE 1
/