CREATE COLUMN TABLE "SBODEMOUS"."AJDT" ("BatchNum" INTEGER CS_INT, "TransId" INTEGER CS_INT NOT NULL , "BtfStatus" NVARCHAR(1) DEFAULT 'O', "TransType" NVARCHAR(20) DEFAULT '-1', "BaseRef" NVARCHAR(11), "RefDate" LONGDATE CS_LONGDATE, "Memo" NVARCHAR(254), "Ref1" NVARCHAR(200), "Ref2" NVARCHAR(200), "CreatedBy" INTEGER CS_INT, "LocTotal" DECIMAL(21,6) CS_FIXED, "FcTotal" DECIMAL(21,6) CS_FIXED, "SysTotal" DECIMAL(21,6) CS_FIXED, "TransCode" NVARCHAR(4), "OrignCurr" NVARCHAR(3), "TransRate" DECIMAL(21,6) CS_FIXED, "BtfLine" INTEGER CS_INT, "TransCurr" NVARCHAR(3), "Project" NVARCHAR(20), "DueDate" LONGDATE CS_LONGDATE, "TaxDate" LONGDATE CS_LONGDATE, "PCAddition" NVARCHAR(1) DEFAULT 'N', "FinncPriod" INTEGER CS_INT, "DataSource" NVARCHAR(1) DEFAULT 'N', "UpdateDate" LONGDATE CS_LONGDATE, "CreateDate" LONGDATE CS_LONGDATE, "UserSign" SMALLINT CS_INT, "UserSign2" SMALLINT CS_INT, "RefndRprt" NVARCHAR(1) DEFAULT 'N', "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "ObjType" NVARCHAR(20), "Indicator" NVARCHAR(2), "AdjTran" NVARCHAR(1) DEFAULT 'N', "RevSource" NVARCHAR(1) DEFAULT 'N', "StornoDate" LONGDATE CS_LONGDATE, "StornoToTr" INTEGER CS_INT, "AutoStorno" NVARCHAR(1) DEFAULT 'N', "Corisptivi" NVARCHAR(1) DEFAULT 'N', "VatDate" LONGDATE CS_LONGDATE, "StampTax" NVARCHAR(1) DEFAULT 'N', "Series" INTEGER CS_INT DEFAULT 0, "Number" INTEGER CS_INT, "AutoVAT" NVARCHAR(1) DEFAULT 'N', "DocSeries" INTEGER CS_INT, "FolioPref" NVARCHAR(4), "FolioNum" INTEGER CS_INT, "CreateTime" SMALLINT CS_INT, "BlockDunn" NVARCHAR(1) DEFAULT 'N', "ReportEU" NVARCHAR(1) DEFAULT 'N', "Report347" NVARCHAR(1) DEFAULT 'N', "Printed" NVARCHAR(1) DEFAULT 'N', "DocType" NVARCHAR(60), "AttNum" INTEGER CS_INT DEFAULT 0, "GenRegNo" NVARCHAR(1) DEFAULT 'N', "RG23APart2" INTEGER CS_INT, "RG23CPart2" INTEGER CS_INT, "MatType" INTEGER CS_INT, "Creator" NVARCHAR(155), "Approver" NVARCHAR(155), "Location" INTEGER CS_INT, "SeqCode" SMALLINT CS_INT, "Serial" INTEGER CS_INT, "SeriesStr" NVARCHAR(3), "SubStr" NVARCHAR(3), "AutoWT" NVARCHAR(1) DEFAULT 'N', "WTSum" DECIMAL(21,6) CS_FIXED, "WTSumSC" DECIMAL(21,6) CS_FIXED, "WTSumFC" DECIMAL(21,6) CS_FIXED, "WTApplied" DECIMAL(21,6) CS_FIXED, "WTAppliedS" DECIMAL(21,6) CS_FIXED, "WTAppliedF" DECIMAL(21,6) CS_FIXED, "BaseAmnt" DECIMAL(21,6) CS_FIXED, "BaseAmntSC" DECIMAL(21,6) CS_FIXED, "BaseAmntFC" DECIMAL(21,6) CS_FIXED, "BaseVtAt" DECIMAL(21,6) CS_FIXED, "BaseVtAtSC" DECIMAL(21,6) CS_FIXED, "BaseVtAtFC" DECIMAL(21,6) CS_FIXED, "VersionNum" NVARCHAR(13), "BaseTrans" INTEGER CS_INT, "ResidenNum" NVARCHAR(1) DEFAULT '1', "OperatCode" NVARCHAR(1), "Ref3" NVARCHAR(200), "SSIExmpt" NVARCHAR(1), "SignMsg" NCLOB MEMORY THRESHOLD 1000, "SignDigest" NCLOB MEMORY THRESHOLD 1000, "CertifNum" NVARCHAR(50), "KeyVersion" INTEGER CS_INT, "CUP" INTEGER CS_INT, "CIG" INTEGER CS_INT, "SupplCode" NVARCHAR(254), "SPSrcType" INTEGER CS_INT, "SPSrcID" INTEGER CS_INT, "SPSrcDLN" INTEGER CS_INT, "DeferedTax" NVARCHAR(1) DEFAULT 'N', "AgrNo" INTEGER CS_INT, "SeqNum" INTEGER CS_INT, "ECDPosTyp" NVARCHAR(1) DEFAULT 'N', "RptPeriod" NVARCHAR(5), "RptMonth" LONGDATE CS_LONGDATE, "ExTransId" INTEGER CS_INT, "PrlLinked" NVARCHAR(1) DEFAULT 'N', "PTICode" NVARCHAR(5), "Letter" NVARCHAR(1), "FolNumFrom" INTEGER CS_INT, "FolNumTo" INTEGER CS_INT, "RepSection" NVARCHAR(3), "ExclTaxRep" NVARCHAR(1) DEFAULT 'N', "IsCoEntry" NVARCHAR(1) DEFAULT 'N', "SAPPassprt" NCLOB MEMORY THRESHOLD 1000, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, "EBookable" NVARCHAR(1) DEFAULT 'N', "DataVers" INTEGER CS_INT DEFAULT 1, "SAFTType" NVARCHAR(1) DEFAULT '-', "AllocNum" NVARCHAR(50), "SAFTTypeEx" NVARCHAR(10) DEFAULT '-', PRIMARY KEY ("TransId", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOUS"."AJDT" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$TransType$CreatedBy$','TransType','CreatedBy'));
CREATE INDEX "AJDT_TRANS_TYPE" ON "SBODEMOUS"."AJDT" ( "TransType" ASC, "CreatedBy" ASC );
CREATE INDEX "AJDT_REFDATE" ON "SBODEMOUS"."AJDT" ( "RefDate" ASC );
CREATE INDEX "AJDT_STORNO_TRA" ON "SBODEMOUS"."AJDT" ( "StornoToTr" ASC )