CREATE COLUMN TABLE "SBODEMODE"."CSV4" ("DocEntry" INTEGER CS_INT NOT NULL , "LineNum" INTEGER CS_INT DEFAULT -1, "GroupNum" INTEGER CS_INT DEFAULT -1, "ExpnsCode" INTEGER CS_INT DEFAULT -1, "RelateType" INTEGER CS_INT DEFAULT 1, "StcCode" NVARCHAR(8), "StaCode" NVARCHAR(8), "staType" INTEGER CS_INT, "TaxRate" DECIMAL(21,6) CS_FIXED, "TaxAcct" NVARCHAR(15), "TaxSum" DECIMAL(21,6) CS_FIXED, "TaxSumFrgn" DECIMAL(21,6) CS_FIXED, "TaxSumSys" DECIMAL(21,6) CS_FIXED, "BaseSum" DECIMAL(21,6) CS_FIXED, "BaseSumFrg" DECIMAL(21,6) CS_FIXED, "BaseSumSys" DECIMAL(21,6) CS_FIXED, "ObjectType" NVARCHAR(20) DEFAULT '166', "LogInstanc" INTEGER CS_INT DEFAULT 0, "TaxStatus" NVARCHAR(1) DEFAULT 'Y', "VatApplied" DECIMAL(21,6) CS_FIXED, "VatAppldFC" DECIMAL(21,6) CS_FIXED, "VatAppldSC" DECIMAL(21,6) CS_FIXED, "LineSeq" INTEGER CS_INT NOT NULL , "DeferrAcct" NVARCHAR(15), "BaseType" INTEGER CS_INT DEFAULT -1, "BaseAbs" INTEGER CS_INT DEFAULT -1, "BaseSeq" INTEGER CS_INT, "DeductTax" DECIMAL(21,6) CS_FIXED, "DdctTaxFrg" DECIMAL(21,6) CS_FIXED, "DdctTaxSys" DECIMAL(21,6) CS_FIXED, "BaseAppld" DECIMAL(21,6) CS_FIXED, "BaseApldFC" DECIMAL(21,6) CS_FIXED, "BaseApldSC" DECIMAL(21,6) CS_FIXED, "NonDdctPrc" DECIMAL(21,6) CS_FIXED, "NonDdctAct" NVARCHAR(15), "TaxInPrice" NVARCHAR(1) DEFAULT 'N', "Exempt" NVARCHAR(1) DEFAULT 'N', "TaxExpAct" NVARCHAR(15), "OnHoldTax" DECIMAL(21,6) CS_FIXED, "OnHoldTaxF" DECIMAL(21,6) CS_FIXED, "OnHoldTaxS" DECIMAL(21,6) CS_FIXED, "InGrossRev" NVARCHAR(1) DEFAULT 'N', "TaxSumOrg" DECIMAL(21,6) CS_FIXED, "TaxSumOrgF" DECIMAL(21,6) CS_FIXED, "TaxSumOrgS" DECIMAL(21,6) CS_FIXED, "OpenTax" DECIMAL(21,6) CS_FIXED, "OpenTaxFC" DECIMAL(21,6) CS_FIXED, "OpenTaxSC" DECIMAL(21,6) CS_FIXED, "Unencumbrd" NVARCHAR(1) DEFAULT 'N', "TaxOnRI" NVARCHAR(1) DEFAULT 'N', "RvsChrgPrc" DECIMAL(21,6) CS_FIXED, "RvsChrgTax" DECIMAL(21,6) CS_FIXED, "RvsChrgSC" DECIMAL(21,6) CS_FIXED, "RvsChrgFC" DECIMAL(21,6) CS_FIXED, "InFirstIns" NVARCHAR(1) DEFAULT 'N', "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, "CESTrel" NVARCHAR(1) DEFAULT 'N', PRIMARY KEY ("DocEntry", "LineSeq")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMODE"."CSV4" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$DocEntry$LineNum$GroupNum$ExpnsCode$StcCode$StaCode$staType$','DocEntry','LineNum','GroupNum','ExpnsCode','StcCode','StaCode','staType'));
CREATE INDEX "CSV4_SCONDARY" ON "SBODEMODE"."CSV4" ( "DocEntry" ASC, "LineNum" ASC, "GroupNum" ASC, "ExpnsCode" ASC, "StcCode" ASC, "StaCode" ASC, "staType" ASC )