CREATE TABLE GRSPARAMFORN (
  CDFORNECED VARCHAR2(21) NOT NULL, 
  VRLIMPESOENTRE DOUBLE PRECISION DEFAULT NULL NULL, 
  QTLIMFORNECDIA DOUBLE PRECISION DEFAULT NULL NULL, 
  SGUNIDADE VARCHAR2(10) DEFAULT NULL NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT NULL NULL,
  CONSTRAINT PK_GRS_CDFORNECED PRIMARY KEY(CDFORNECED)
)
/
ALTER TABLE GRSPARAMFORN ADD CONSTRAINT FK_GRS_CDFORNECED FOREIGN KEY (CDFORNECED) REFERENCES FORNECEDOR (CDFORNECED)
/
ALTER TABLE GRSPARAMFORN ADD CONSTRAINT CKC_IDATIVO_GRSPARAMFORN CHECK (IDATIVO IN ('S', 'N'))
/
CREATE INDEX GRS_SGUNIDADE_FK ON GRSPARAMFORN (SGUNIDADE ASC)