CREATE COLUMN TABLE "SBODEMODE"."ADPS" ("DeposId" INTEGER CS_INT DEFAULT 0 NOT NULL , "DeposType" NVARCHAR(1) DEFAULT 'K', "DeposNum" INTEGER CS_INT NOT NULL , "DeposDate" LONGDATE CS_LONGDATE, "DeposCurr" NVARCHAR(3), "BanckAcct" NVARCHAR(15), "DeposAcct" NVARCHAR(50), "DeposBrnch" NVARCHAR(50), "Memo" NVARCHAR(254), "LocTotal" DECIMAL(21,6) CS_FIXED, "FcTotal" DECIMAL(21,6) CS_FIXED, "SysTotal" DECIMAL(21,6) CS_FIXED, "TransAbs" INTEGER CS_INT, "Ref1" NVARCHAR(11), "Ref2" NVARCHAR(11), "DocTime" SMALLINT CS_INT, "AllocAcct" NVARCHAR(15), "ChkType" NVARCHAR(1) DEFAULT 'C', "DpsBank" NVARCHAR(30), "DpostorNam" NVARCHAR(30), "Printed" NVARCHAR(1) DEFAULT 'N', "DocRate" DECIMAL(21,6) CS_FIXED, "CrdBankAct" NVARCHAR(15), "IsCard" NVARCHAR(1) DEFAULT 'A', "Transfered" NVARCHAR(1) DEFAULT 'N', "UpdateDate" LONGDATE CS_LONGDATE, "Splited" NVARCHAR(1) DEFAULT 'N', "CreateDate" LONGDATE CS_LONGDATE, "VatAct" NVARCHAR(15), "ComissAct" NVARCHAR(15), "VatTotal" DECIMAL(21,6) CS_FIXED, "Comission" DECIMAL(21,6) CS_FIXED, "ComissDate" LONGDATE CS_LONGDATE, "TaxDate" LONGDATE CS_LONGDATE, "Series" INTEGER CS_INT NOT NULL , "DataSource" NVARCHAR(1) DEFAULT 'N', "ObjType" NVARCHAR(20), "FinncPriod" INTEGER CS_INT, "VatTotlSys" DECIMAL(21,6) CS_FIXED, "ComissnSys" DECIMAL(21,6) CS_FIXED, "UserSign" SMALLINT CS_INT, "DepostNorm" NVARCHAR(8), "PostType" NVARCHAR(1) DEFAULT 'C', "BankCountr" NVARCHAR(3), "Canceled" NVARCHAR(1) DEFAULT 'N', "CnclDps" INTEGER CS_INT DEFAULT -1, "CommisVat" NVARCHAR(8), "SeqCode" SMALLINT CS_INT, "Serial" INTEGER CS_INT, "SeriesStr" NVARCHAR(3), "SubStr" NVARCHAR(3), "Project" NVARCHAR(20), "ReconAfter" NVARCHAR(1) DEFAULT 'Y', "OcrCode" NVARCHAR(8), "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "ComisFC" DECIMAL(21,6) CS_FIXED, "VatTotlFC" DECIMAL(21,6) CS_FIXED, "ComisCurr" NVARCHAR(3), "SupplCode" NVARCHAR(254), "BPLId" INTEGER CS_INT, "SysRate" DECIMAL(21,6) CS_FIXED, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, "IncomeAct" NVARCHAR(15), "IncomeLC" DECIMAL(21,6) CS_FIXED, "IncomeFC" DECIMAL(21,6) CS_FIXED, "IncomeSC" DECIMAL(21,6) CS_FIXED, "UpdateTS" INTEGER CS_INT, "VersionNum" NVARCHAR(13), "EncryptIV" NVARCHAR(100), "EnDeposAcc" NCLOB MEMORY THRESHOLD 1000, "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "UserSign2" SMALLINT CS_INT, PRIMARY KEY ("DeposId", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "ADPS_VIS_NUM" ON "SBODEMODE"."ADPS" ( "DeposNum" ASC, "Series" ASC, "LogInstanc" ASC )