CREATE COLUMN TABLE "SBODEMOPT"."OILM" ("MessageID" INTEGER CS_INT NOT NULL , "DocEntry" INTEGER CS_INT, "TransType" INTEGER CS_INT DEFAULT -1, "DocLineNum" INTEGER CS_INT, "Quantity" DECIMAL(21,6) CS_FIXED, "EffectQty" DECIMAL(21,6) CS_FIXED, "LocType" SMALLINT CS_INT, "LocCode" NVARCHAR(8), "TotalLC" DECIMAL(21,6) CS_FIXED, "TotalFC" DECIMAL(21,6) CS_FIXED, "TotalSC" DECIMAL(21,6) CS_FIXED, "BaseAbsEnt" INTEGER CS_INT, "BaseType" INTEGER CS_INT DEFAULT -1, "BaseCurr" NVARCHAR(3), "Currency" NVARCHAR(3), "AccumType" INTEGER CS_INT DEFAULT 0, "ActionType" INTEGER CS_INT DEFAULT 5, "ExpensesLC" DECIMAL(21,6) CS_FIXED, "ExpensesFC" DECIMAL(21,6) CS_FIXED, "ExpensesSC" DECIMAL(21,6) CS_FIXED, "DocDueDate" LONGDATE CS_LONGDATE, "ItemCode" NVARCHAR(50), "BPCardCode" NVARCHAR(15), "DocDate" LONGDATE CS_LONGDATE, "DocRate" DECIMAL(21,6) CS_FIXED, "Comment" NVARCHAR(254), "JrnlMemo" NVARCHAR(50), "Ref1" NVARCHAR(11), "Ref2" NVARCHAR(100), "BaseLine" INTEGER CS_INT DEFAULT -1, "SnBType" INTEGER CS_INT DEFAULT -1, "CreateTime" SMALLINT CS_INT, "DataSource" NVARCHAR(1) DEFAULT 'N', "CreateDate" LONGDATE CS_LONGDATE, "OcrCode" NVARCHAR(8), "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "DocPrice" DECIMAL(21,6) CS_FIXED, "CardName" NVARCHAR(100), "Dscription" NVARCHAR(200), "TreeType" NVARCHAR(1) DEFAULT 'N', "ApplObj" INTEGER CS_INT DEFAULT -1, "AppObjAbs" INTEGER CS_INT DEFAULT -1, "AppObjType" NVARCHAR(1), "AppObjLine" INTEGER CS_INT DEFAULT -1, "BASE_REF" NVARCHAR(11), "TransSeqRf" INTEGER CS_INT DEFAULT -1, "LayerIDRef" INTEGER CS_INT DEFAULT -1, "VersionNum" NVARCHAR(13), "PriceRate" DECIMAL(21,6) CS_FIXED, "PriceCurr" NVARCHAR(3), "DocTotal" DECIMAL(21,6) CS_FIXED, "Price" DECIMAL(21,6) CS_FIXED, "CIShbQty" DECIMAL(21,6) CS_FIXED, "SubLineNum" INTEGER CS_INT DEFAULT -1, "PrjCode" NVARCHAR(20), "SlpCode" INTEGER CS_INT DEFAULT -1, "TaxDate" LONGDATE CS_LONGDATE, "UseDocPric" NVARCHAR(1) DEFAULT 'N', "VendorNum" NVARCHAR(50), "SerialNum" NVARCHAR(17), "BlockNum" NVARCHAR(100), "ImportLog" NVARCHAR(20), "Location" INTEGER CS_INT, "DocPrcRate" DECIMAL(21,6) CS_FIXED, "DocPrcCurr" NVARCHAR(3), "CgsOcrCod" NVARCHAR(8), "CgsOcrCod2" NVARCHAR(8), "CgsOcrCod3" NVARCHAR(8), "CgsOcrCod4" NVARCHAR(8), "CgsOcrCod5" NVARCHAR(8), "BSubLineNo" INTEGER CS_INT DEFAULT -1, "AppSubLine" INTEGER CS_INT DEFAULT -1, "UserSign" SMALLINT CS_INT, "SysRate" DECIMAL(21,6) CS_FIXED, "ExFromRpt" NVARCHAR(1) DEFAULT 'N', "Ref3" NVARCHAR(100), "EnSetCost" NVARCHAR(1) DEFAULT 'N', "RetCost" DECIMAL(21,6) CS_FIXED, "DocAction" INTEGER CS_INT, "UseShpdGd" NVARCHAR(1) DEFAULT 'N', "AddTotalLC" DECIMAL(21,6) CS_FIXED, "AddExpLC" DECIMAL(21,6) CS_FIXED, "IsNegLnQty" NVARCHAR(1) DEFAULT 'N', "StgSeqNum" INTEGER CS_INT, "StgEntry" INTEGER CS_INT, "StgDesc" NVARCHAR(100), PRIMARY KEY ("MessageID")) UNLOAD PRIORITY 0  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."OILM" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$TransType$DocEntry$DocLineNum$SubLineNum$','TransType','DocEntry','DocLineNum','SubLineNum'));
ALTER TABLE "SBODEMOPT"."OILM" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ApplObj$AppObjAbs$AppObjType$AppObjLine$','ApplObj','AppObjAbs','AppObjType','AppObjLine'));
ALTER TABLE "SBODEMOPT"."OILM" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$BaseType$BaseAbsEnt$BaseLine$BSubLineNo$','BaseType','BaseAbsEnt','BaseLine','BSubLineNo'));
CREATE INDEX "OILM_CARD" ON "SBODEMOPT"."OILM" ( "BPCardCode" ASC );
CREATE INDEX "OILM_DocLine" ON "SBODEMOPT"."OILM" ( "TransType" ASC, "DocEntry" ASC, "DocLineNum" ASC, "SubLineNum" ASC );
CREATE INDEX "OILM_APPOBJ" ON "SBODEMOPT"."OILM" ( "ApplObj" ASC, "AppObjAbs" ASC, "AppObjType" ASC, "AppObjLine" ASC );
CREATE INDEX "OILM_BASEOBJ" ON "SBODEMOPT"."OILM" ( "BaseType" ASC, "BaseAbsEnt" ASC, "BaseLine" ASC, "BSubLineNo" ASC )