CREATE COLUMN TABLE "SBODEMOUS"."IPF1" ("DocEntry" INTEGER CS_INT NOT NULL , "LineNum" INTEGER CS_INT NOT NULL , "BaseType" INTEGER CS_INT DEFAULT -1, "BaseEntry" INTEGER CS_INT, "ItemCode" NVARCHAR(50), "Dscription" NVARCHAR(200), "Quantity" DECIMAL(21,6) CS_FIXED, "PriceFOB" DECIMAL(21,6) CS_FIXED, "Currency" NVARCHAR(3), "Rate" DECIMAL(21,6) CS_FIXED, "Custom" DECIMAL(21,6) CS_FIXED, "CustomFC" DECIMAL(21,6) CS_FIXED, "Cost" DECIMAL(21,6) CS_FIXED, "CostFC" DECIMAL(21,6) CS_FIXED, "PriceAtWH" DECIMAL(21,6) CS_FIXED, "PricAtWHFC" DECIMAL(21,6) CS_FIXED, "LineTotal" DECIMAL(21,6) CS_FIXED, "TotalFrgn" DECIMAL(21,6) CS_FIXED, "Volume" DECIMAL(21,6) CS_FIXED, "UnitCode" SMALLINT CS_INT, "Weight1" DECIMAL(21,6) CS_FIXED, "UnitCode1" SMALLINT CS_INT, "Weight2" DECIMAL(21,6) CS_FIXED, "UnitCode2" SMALLINT CS_INT, "CardCode" NVARCHAR(15), "Reference" NVARCHAR(16), "OrigLine" INTEGER CS_INT, "FactNoCust" DECIMAL(21,6) CS_FIXED, "FacWthCust" DECIMAL(21,6) CS_FIXED, "PriceList" SMALLINT CS_INT, "CostOH" NVARCHAR(1) DEFAULT 'Y', "StockEval" NVARCHAR(1) DEFAULT 'Y', "UseBaseUn" NVARCHAR(1), "BlockNum" NVARCHAR(100), "ImportLog" NVARCHAR(20), "WhsCode" NVARCHAR(8), "OrigRow" INTEGER CS_INT, "Locked" NVARCHAR(1) DEFAULT 'N', "OrigWhs" NVARCHAR(8), "ReleaseNum" INTEGER CS_INT, "VarCosts" DECIMAL(21,6) CS_FIXED, "ConstCosts" DECIMAL(21,6) CS_FIXED, "VarCostsFR" DECIMAL(21,6) CS_FIXED, "CnstCostFR" DECIMAL(21,6) CS_FIXED, "UserCustom" DECIMAL(21,6) CS_FIXED, "UsrCusomFC" DECIMAL(21,6) CS_FIXED, "FobValue" DECIMAL(21,6) CS_FIXED, "FobValueFC" DECIMAL(21,6) CS_FIXED, "TtlExpndLC" DECIMAL(21,6) CS_FIXED, "TtlExpndFC" DECIMAL(21,6) CS_FIXED, "TtlCustLC" DECIMAL(21,6) CS_FIXED, "TtlCustFC" DECIMAL(21,6) CS_FIXED, "TtlCostLC" DECIMAL(21,6) CS_FIXED, "TtlCostFC" DECIMAL(21,6) CS_FIXED, "TtlVolume" DECIMAL(21,6) CS_FIXED, "TtlWeight" DECIMAL(21,6) CS_FIXED, "BaseRowNum" INTEGER CS_INT, "TtlCustSC" DECIMAL(21,6) CS_FIXED, "TtlExpndSC" DECIMAL(21,6) CS_FIXED, "OriBAbsEnt" INTEGER CS_INT DEFAULT -1, "OriBLinNum" INTEGER CS_INT DEFAULT -1, "TargetDoc" INTEGER CS_INT, "FobValCurr" NVARCHAR(3), "FobnLaC" DECIMAL(21,6) CS_FIXED, "FobnLaCFC" DECIMAL(21,6) CS_FIXED, "NumPerMsr" DECIMAL(21,6) CS_FIXED, "Project" NVARCHAR(20), "OcrCode" NVARCHAR(8), "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "OriBDocTyp" NVARCHAR(11) DEFAULT '-1', "CustRate" DECIMAL(21,6) CS_FIXED, "LFixCost" DECIMAL(21,6) CS_FIXED, "LFixCostFC" DECIMAL(21,6) CS_FIXED, "LVarCost" DECIMAL(21,6) CS_FIXED, "LVarCostFC" DECIMAL(21,6) CS_FIXED, "CstmsRate" DECIMAL(21,6) CS_FIXED, "VatGroup" NVARCHAR(8), "VatPrcnt" DECIMAL(21,6) CS_FIXED, "VatSum" DECIMAL(21,6) CS_FIXED, "SnbType" NVARCHAR(20) DEFAULT '-1', "SnbAbsEnt" INTEGER CS_INT DEFAULT -1, "SysNumber" INTEGER CS_INT, "DistNumber" NVARCHAR(36), "ExciseSum" DECIMAL(21,6) CS_FIXED, "ExcisSumFC" DECIMAL(21,6) CS_FIXED, "ExcInStk" NVARCHAR(1) DEFAULT 'N', "CustomSum" DECIMAL(21,6) CS_FIXED, "CustSumFC" DECIMAL(21,6) CS_FIXED, "CstmInStk" NVARCHAR(1) DEFAULT 'Y', "CstmVatSum" DECIMAL(21,6) CS_FIXED, "CstmVatFC" DECIMAL(21,6) CS_FIXED, "CstmVatStk" NVARCHAR(1) DEFAULT 'Y', "CCDEntry" INTEGER CS_INT, "CCDNumber" NVARCHAR(20), "ExcisSumSC" DECIMAL(21,6) CS_FIXED, "CustSumSC" DECIMAL(21,6) CS_FIXED, "CstmVatSC" DECIMAL(21,6) CS_FIXED, "InvQty" DECIMAL(21,6) CS_FIXED, "CCDLineNum" INTEGER CS_INT, "TtlVolCCM" DECIMAL(21,6) CS_FIXED, "ExcImpQty" DECIMAL(21,6) CS_FIXED, "ExcFixAmnt" DECIMAL(21,6) CS_FIXED, "ExcRate" DECIMAL(21,6) CS_FIXED, "ExcAmntUoM" DECIMAL(21,6) CS_FIXED, "ExcAmntAdV" DECIMAL(21,6) CS_FIXED, "ExcImpQUoM" INTEGER CS_INT, "ExcBasAmnt" DECIMAL(21,6) CS_FIXED, "LineNumV3" INTEGER CS_INT, "FobVal2" DECIMAL(21,6) CS_FIXED DEFAULT 0, "FobVal2FC" DECIMAL(21,6) CS_FIXED DEFAULT 0, "EncryptIV" NVARCHAR(100), "UoMNum" DECIMAL(21,6) CS_FIXED, "UoMDen" DECIMAL(21,6) CS_FIXED, PRIMARY KEY ("DocEntry", "LineNum")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOUS"."IPF1" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$BaseEntry$OrigLine$','BaseEntry','OrigLine'));
ALTER TABLE "SBODEMOUS"."IPF1" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$BaseEntry$ItemCode$','BaseEntry','ItemCode'));
ALTER TABLE "SBODEMOUS"."IPF1" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$BaseType$BaseEntry$OrigLine$','BaseType','BaseEntry','OrigLine'));
CREATE CPBTREE INDEX "IPF1_BASE" ON "SBODEMOUS"."IPF1" ( "BaseEntry" ASC, "OrigLine" ASC );
CREATE CPBTREE INDEX "IPF1_ITEM" ON "SBODEMOUS"."IPF1" ( "BaseEntry" ASC, "ItemCode" ASC );
CREATE CPBTREE INDEX "IPF1_CURRENCY" ON "SBODEMOUS"."IPF1" ( "Currency" ASC );
CREATE CPBTREE INDEX "IPF1_BASE_LINE" ON "SBODEMOUS"."IPF1" ( "BaseType" ASC, "BaseEntry" ASC, "OrigLine" ASC )