CREATE COLUMN TABLE "SBODEMOPT"."IEI3" ("DocEntry" INTEGER CS_INT NOT NULL , "ExpnsCode" INTEGER CS_INT, "LineTotal" DECIMAL(21,6) CS_FIXED, "TotalFrgn" DECIMAL(21,6) CS_FIXED, "TotalSumSy" DECIMAL(21,6) CS_FIXED, "PaidToDate" DECIMAL(21,6) CS_FIXED, "PaidFC" DECIMAL(21,6) CS_FIXED, "PaidSys" DECIMAL(21,6) CS_FIXED, "Comments" NVARCHAR(100), "ObjType" NVARCHAR(20) DEFAULT '140000010', "LogInstanc" INTEGER CS_INT DEFAULT 0, "DistrbMthd" NVARCHAR(1), "TaxStatus" NVARCHAR(1) DEFAULT 'Y', "VatGroup" NVARCHAR(8), "VatPrcnt" DECIMAL(21,6) CS_FIXED, "VatSum" DECIMAL(21,6) CS_FIXED, "VatSumFrgn" DECIMAL(21,6) CS_FIXED, "VatSumSy" DECIMAL(21,6) CS_FIXED, "DedVatSum" DECIMAL(21,6) CS_FIXED, "DedVatSumF" DECIMAL(21,6) CS_FIXED, "DedVatSumS" DECIMAL(21,6) CS_FIXED, "IsAcquistn" NVARCHAR(1) DEFAULT 'N', "TaxCode" NVARCHAR(8), "TaxType" NVARCHAR(1) DEFAULT 'Y', "WTLiable" NVARCHAR(1), "VatApplied" DECIMAL(21,6) CS_FIXED, "VatAppldFC" DECIMAL(21,6) CS_FIXED, "VatAppldSC" DECIMAL(21,6) CS_FIXED, "EquVatPer" DECIMAL(21,6) CS_FIXED, "EquVatSum" DECIMAL(21,6) CS_FIXED, "EquVatSumF" DECIMAL(21,6) CS_FIXED, "EquVatSumS" DECIMAL(21,6) CS_FIXED, "LineVat" DECIMAL(21,6) CS_FIXED, "LineVatF" DECIMAL(21,6) CS_FIXED, "LineVatS" DECIMAL(21,6) CS_FIXED, "BaseMethod" NVARCHAR(1), "Stock" NVARCHAR(1), "LstPchPrce" NVARCHAR(1), "AnalysRpt" NVARCHAR(1) DEFAULT 'N', "BaseAbsEnt" INTEGER CS_INT DEFAULT -1, "BaseType" INTEGER CS_INT DEFAULT -1, "BaseRef" INTEGER CS_INT, "BaseLnNum" INTEGER CS_INT, "LineNum" INTEGER CS_INT DEFAULT -1 NOT NULL , "Status" NVARCHAR(1) DEFAULT 'O', "TrgType" INTEGER CS_INT, "TrgAbsEnt" INTEGER CS_INT DEFAULT -1, "StDstr" DECIMAL(21,6) CS_FIXED, "StDstrSC" DECIMAL(21,6) CS_FIXED, "StDstrFC" DECIMAL(21,6) CS_FIXED, "FixCurr" NVARCHAR(3), "VatDscntPr" DECIMAL(21,6) CS_FIXED, "OcrCode" NVARCHAR(8), "TaxDistMtd" NVARCHAR(1), "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "Project" NVARCHAR(20), "VatGrpSrc" NVARCHAR(1) DEFAULT 'N', "DrawnTotal" DECIMAL(21,6) CS_FIXED, "DrawnFC" DECIMAL(21,6) CS_FIXED, "DrawnSC" DECIMAL(21,6) CS_FIXED, "GrsAmount" DECIMAL(21,6) CS_FIXED, "GrsFC" DECIMAL(21,6) CS_FIXED, "GrsSC" DECIMAL(21,6) CS_FIXED, "BaseTotal" NVARCHAR(1) DEFAULT 'N', "RetReqLC" DECIMAL(21,6) CS_FIXED, "RetReqFC" DECIMAL(21,6) CS_FIXED, "RetReqSC" DECIMAL(21,6) CS_FIXED, "RRVatLC" DECIMAL(21,6) CS_FIXED, "RRVatFC" DECIMAL(21,6) CS_FIXED, "RRVatSC" DECIMAL(21,6) CS_FIXED, "EncryptIV" NVARCHAR(100), "ExtTaxRate" DECIMAL(21,6) CS_FIXED, "ExtTaxSum" DECIMAL(21,6) CS_FIXED, "TaxAmtSrc" NVARCHAR(1) DEFAULT 'S', "ExtTaxSumF" DECIMAL(21,6) CS_FIXED, "ExtTaxSumS" DECIMAL(21,6) CS_FIXED, "CUSplit" NVARCHAR(1) DEFAULT 'N', PRIMARY KEY ("DocEntry", "LineNum")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."IEI3" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$DocEntry$BaseAbsEnt$','DocEntry','BaseAbsEnt'));
CREATE INDEX "IEI3_DOCUMENT" ON "SBODEMOPT"."IEI3" ( "DocEntry" ASC, "BaseAbsEnt" ASC )