CREATE COLUMN TABLE "SBODEMOPT"."OBTA" ("AbsEntry" INTEGER CS_INT NOT NULL , "Status" NVARCHAR(1) DEFAULT 'O', "Canceled" NVARCHAR(1) DEFAULT 'N', "DocNum" INTEGER CS_INT NOT NULL , "DocRate" DECIMAL(21,6) CS_FIXED, "TaxCat" INTEGER CS_INT, "Type" SMALLINT CS_INT DEFAULT 1, "Oper" SMALLINT CS_INT DEFAULT 1, "RefVisType" INTEGER CS_INT DEFAULT 1, "RefObjType" INTEGER CS_INT, "RefDocEnt" INTEGER CS_INT, "RefDocNum" INTEGER CS_INT, "StateUf" NVARCHAR(2), "PostDate" LONGDATE CS_LONGDATE, "CodDa" NVARCHAR(1) DEFAULT '1', "NumDa" NVARCHAR(20), "CodAut" NVARCHAR(30), "VlDa" DECIMAL(21,6) CS_FIXED, "VlDaSc" DECIMAL(21,6) CS_FIXED, "DtVcto" LONGDATE CS_LONGDATE, "DtPgto" LONGDATE CS_LONGDATE, "CodAj" NVARCHAR(10), "DescCompAj" NVARCHAR(120), "BcIcms" DECIMAL(21,6) CS_FIXED, "BcIcmsSc" DECIMAL(21,6) CS_FIXED, "AliqIcms" DECIMAL(21,6) CS_FIXED, "VlIcms" DECIMAL(21,6) CS_FIXED, "VlIcmsSc" DECIMAL(21,6) CS_FIXED, "VlOutros" DECIMAL(21,6) CS_FIXED, "CodAjApur" NVARCHAR(10), "NumProc" NVARCHAR(10), "IndProc" NVARCHAR(1), "Ser" NVARCHAR(3), "Sub" NVARCHAR(3), "NumDoc" INTEGER CS_INT, "DtDoc" LONGDATE CS_LONGDATE, "CodMod" NVARCHAR(6), "CodPart" NVARCHAR(15), "CodRec" NVARCHAR(15), "GLAcct" NVARCHAR(15), "ItemCode" NVARCHAR(50), "BPLId" INTEGER CS_INT, "UserSign" SMALLINT CS_INT, "UserSign2" SMALLINT CS_INT, "CreateDate" LONGDATE CS_LONGDATE, "CreateTime" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "TransId" INTEGER CS_INT, PRIMARY KEY ("AbsEntry")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "OBTA_NUM" ON "SBODEMOPT"."OBTA" ( "DocNum" ASC )