CREATE COLUMN TABLE "SBODEMODE"."AINC" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "Series" INTEGER CS_INT NOT NULL , "CountDate" LONGDATE CS_LONGDATE, "Time" INTEGER CS_INT, "CountType" NVARCHAR(1) DEFAULT '1', "Taker1Type" INTEGER CS_INT DEFAULT 12, "Taker1Id" INTEGER CS_INT, "Taker2Type" INTEGER CS_INT DEFAULT 12, "Taker2Id" INTEGER CS_INT, "Status" NVARCHAR(1) DEFAULT 'O', "Ref2" NVARCHAR(11), "Remarks" NCLOB MEMORY THRESHOLD 1000, "LogIns" INTEGER CS_INT NOT NULL , "UserSign" SMALLINT CS_INT, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "CreateDate" LONGDATE CS_LONGDATE, "ObjType" NVARCHAR(20) DEFAULT '1470000065', "WddStatus" NVARCHAR(1) DEFAULT '-', "DraftKey" INTEGER CS_INT DEFAULT -1, "Printed" NVARCHAR(1) DEFAULT 'N', "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(200), "TeamCount" INTEGER CS_INT DEFAULT 0, "IndvCount" INTEGER CS_INT DEFAULT 0, "DiffQty" DECIMAL(21,6) CS_FIXED, "DiffPercen" DECIMAL(21,6) CS_FIXED, "UpdateTS" INTEGER CS_INT, "CreateTime" SMALLINT CS_INT, "PIndicator" NVARCHAR(10) DEFAULT ' ', "FinncPriod" INTEGER CS_INT, "PostDate" LONGDATE CS_LONGDATE, "VersionNum" NVARCHAR(13), "DataSource" NVARCHAR(1) DEFAULT 'N', "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, "YearEndDt" LONGDATE CS_LONGDATE, "UpdateTime" INTEGER CS_INT, PRIMARY KEY ("DocEntry", "LogIns")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "AINC_SERIES" ON "SBODEMODE"."AINC" ( "Series" ASC, "DocNum" ASC, "LogIns" ASC )