CREATE COLUMN TABLE "SBODEMOUS"."ACLG" ("ClgCode" INTEGER CS_INT NOT NULL , "CardCode" NVARCHAR(15), "Notes" NCLOB MEMORY THRESHOLD 1000, "CntctDate" LONGDATE CS_LONGDATE, "CntctTime" INTEGER CS_INT, "Recontact" LONGDATE CS_LONGDATE, "Closed" NVARCHAR(1) DEFAULT 'N', "CloseDate" LONGDATE CS_LONGDATE, "ContactPer" NVARCHAR(90), "Tel" NVARCHAR(50), "Fax" NVARCHAR(50), "CntctSbjct" SMALLINT CS_INT DEFAULT -1, "Transfered" NVARCHAR(1) DEFAULT 'N', "DocType" NVARCHAR(20) DEFAULT '-1', "DocNum" NVARCHAR(50), "DocEntry" NVARCHAR(50), "Attachment" NCLOB MEMORY THRESHOLD 1000, "DataSource" NVARCHAR(1) DEFAULT 'N', "AttendUser" SMALLINT CS_INT, "CntctCode" INTEGER CS_INT, "UserSign" SMALLINT CS_INT, "SlpCode" INTEGER CS_INT DEFAULT -1, "Action" NVARCHAR(1) DEFAULT 'C', "Details" NVARCHAR(100), "CntctType" SMALLINT CS_INT DEFAULT -1, "Location" SMALLINT CS_INT DEFAULT -1, "BeginTime" INTEGER CS_INT, "Duration" DECIMAL(21,6) CS_FIXED, "DurType" NVARCHAR(1) DEFAULT 'M', "ENDTime" INTEGER CS_INT, "Priority" NVARCHAR(1) DEFAULT '1', "Reminder" NVARCHAR(1) DEFAULT 'N', "RemQty" DECIMAL(21,6) CS_FIXED, "RemType" NVARCHAR(1) DEFAULT 'M', "OprId" INTEGER CS_INT, "OprLine" SMALLINT CS_INT, "RemDate" LONGDATE CS_LONGDATE, "RemTime" SMALLINT CS_INT, "RemSented" NVARCHAR(1) DEFAULT 'N', "Instance" SMALLINT CS_INT DEFAULT 0, "endDate" LONGDATE CS_LONGDATE, "status" INTEGER CS_INT, "personal" NVARCHAR(1) DEFAULT 'N', "inactive" NVARCHAR(1) DEFAULT 'N', "emailed" NVARCHAR(1) DEFAULT 'N', "tentative" NVARCHAR(1) DEFAULT 'N', "street" NVARCHAR(100), "city" NVARCHAR(100), "country" NVARCHAR(3), "state" NVARCHAR(3), "room" NVARCHAR(50), "parentType" NVARCHAR(20), "parentId" INTEGER CS_INT, "prevActvty" INTEGER CS_INT, "AtcEntry" INTEGER CS_INT, "RecurPat" NVARCHAR(1) DEFAULT 'N', "EndType" NVARCHAR(1) DEFAULT 'N', "SeStartDat" LONGDATE CS_LONGDATE, "SeEndDat" LONGDATE CS_LONGDATE, "MaxOccur" INTEGER CS_INT, "Interval" INTEGER CS_INT DEFAULT 1, "Sunday" NVARCHAR(1) DEFAULT 'N', "Monday" NVARCHAR(1) DEFAULT 'N', "Tuesday" NVARCHAR(1) DEFAULT 'N', "Wednesday" NVARCHAR(1) DEFAULT 'N', "Thursday" NVARCHAR(1) DEFAULT 'N', "Friday" NVARCHAR(1) DEFAULT 'N', "Saturday" NVARCHAR(1) DEFAULT 'N', "SubOption" NVARCHAR(1) DEFAULT '1', "DayInMonth" INTEGER CS_INT, "Month" INTEGER CS_INT, "DayOfWeek" INTEGER CS_INT, "Week" INTEGER CS_INT, "SeriesNum" INTEGER CS_INT, "OrigDate" LONGDATE CS_LONGDATE, "IsRemoved" NVARCHAR(1) DEFAULT 'N', "LastRemind" LONGDATE CS_LONGDATE, "AssignedBy" SMALLINT CS_INT, "AddrName" NVARCHAR(50), "AddrType" NVARCHAR(1) DEFAULT 'S', "AttendEmpl" INTEGER CS_INT, "NextDate" LONGDATE CS_LONGDATE, "NextTime" SMALLINT CS_INT, "OwnerCode" INTEGER CS_INT, "AttendReci" INTEGER CS_INT, "ActType" INTEGER CS_INT, "LaborItem" NVARCHAR(50), "ResCode" NVARCHAR(50), "FIPROJECT" NVARCHAR(20), "UpdateDate" LONGDATE CS_LONGDATE, "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "UserSign2" SMALLINT CS_INT, "DPPStatus" NVARCHAR(1) DEFAULT 'N', "CreateDate" LONGDATE CS_LONGDATE, "EncryptIV" NVARCHAR(100), "DataVers" INTEGER CS_INT DEFAULT 1, "Of365EvtId" NVARCHAR(200), "AssigneeTy" INTEGER CS_INT DEFAULT 12, "VersionNum" NVARCHAR(13), PRIMARY KEY ("ClgCode", "LogInstanc")) UNLOAD PRIORITY 0  AUTO MERGE ;
ALTER TABLE "SBODEMOUS"."ACLG" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$OprId$OprLine$','OprId','OprLine'));
CREATE CPBTREE INDEX "ACLG_CRD_CODE" ON "SBODEMOUS"."ACLG" ( "CardCode" ASC );
CREATE CPBTREE INDEX "ACLG_OPPORT" ON "SBODEMOUS"."ACLG" ( "OprId" ASC, "OprLine" ASC )