CREATE COLUMN TABLE "SBODEMOUS"."AIQR" ("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 '10000071', "DocNum" INTEGER CS_INT, "Series" INTEGER CS_INT, "PriceSrc" INTEGER CS_INT DEFAULT 3, "PriceList" INTEGER CS_INT, "JrnlMemo" NVARCHAR(254), "Status" NVARCHAR(1) DEFAULT 'O', "LogIns" INTEGER CS_INT NOT NULL , "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "CountDate" LONGDATE CS_LONGDATE, "CountTime" INTEGER CS_INT, "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, "CopyOption" NVARCHAR(1) DEFAULT '0', "BaseEntry" INTEGER CS_INT, "PIndicator" NVARCHAR(10) DEFAULT ' ', "FinncPriod" INTEGER CS_INT, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, "YearEndDt" LONGDATE CS_LONGDATE, PRIMARY KEY ("DocEntry", "LogIns")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOUS"."AIQR" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$CreateDate$DocTime$','CreateDate','DocTime'));
CREATE CPBTREE INDEX "AIQR_DOC_DATE" ON "SBODEMOUS"."AIQR" ( "DocDate" ASC );
CREATE CPBTREE INDEX "AIQR_CREATEDATE" ON "SBODEMOUS"."AIQR" ( "CreateDate" ASC, "DocTime" ASC )