CREATE COLUMN TABLE "SBODEMOPT"."AIQI" ("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 NOT NULL , "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(200), "UpdateTS" INTEGER CS_INT, "PIndicator" NVARCHAR(10) DEFAULT ' ', "FinncPriod" INTEGER CS_INT, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, PRIMARY KEY ("DocEntry", "LogIns")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."AIQI" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$CreateDate$DocTime$','CreateDate','DocTime'));
CREATE CPBTREE INDEX "AIQI_DOC_DATE" ON "SBODEMOPT"."AIQI" ( "DocDate" ASC );
CREATE CPBTREE INDEX "AIQI_CREATEDATE" ON "SBODEMOPT"."AIQI" ( "CreateDate" ASC, "DocTime" ASC )