CREATE COLUMN TABLE "SBODEMOPT"."OIOD" ("DocEntry" INTEGER CS_INT NOT NULL , "CreateDate" LONGDATE CS_LONGDATE, "DocTime" SMALLINT CS_INT, "IOffIncAcc" NVARCHAR(15), "DOffDecAcc" NVARCHAR(15), "DocDate" LONGDATE CS_LONGDATE, "Reference" NVARCHAR(11), "Comments" NVARCHAR(254), "DocDueDate" LONGDATE CS_LONGDATE, "DataSource" NVARCHAR(1) DEFAULT 'N', "UserSign" SMALLINT CS_INT, "VersionNum" NVARCHAR(13), "JdtNum" INTEGER CS_INT, "Reference2" NVARCHAR(11), "ObjType" NVARCHAR(20) DEFAULT '310000001', "DocNum" INTEGER CS_INT, "Series" INTEGER CS_INT, "PriceSrc" NVARCHAR(1) DEFAULT '3', "PriceList" INTEGER CS_INT, "JrnlMemo" NVARCHAR(254), "TaxDate" LONGDATE CS_LONGDATE, "Status" NVARCHAR(1) DEFAULT 'O', "LogIns" INTEGER CS_INT, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "WddStatus" NVARCHAR(1) DEFAULT '-', "DraftKey" INTEGER CS_INT DEFAULT -1, "Printed" NVARCHAR(1) DEFAULT 'N', "DocTotal" DECIMAL(21,6) CS_FIXED, "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(100), "UpdateTS" INTEGER CS_INT, "PIndicator" NVARCHAR(10) DEFAULT ' ', "FinncPriod" INTEGER CS_INT, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, PRIMARY KEY ("DocEntry")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."OIOD" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$CreateDate$DocTime$','CreateDate','DocTime'));
CREATE INDEX "OIOD_DOC_DATE" ON "SBODEMOPT"."OIOD" ( "DocDate" ASC );
CREATE INDEX "OIOD_CREATEDATE" ON "SBODEMOPT"."OIOD" ( "CreateDate" ASC, "DocTime" ASC )