CREATE COLUMN TABLE "SBODEMOUS"."ATXI" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "DocType" NVARCHAR(1) DEFAULT 'I', "CANCELED" NVARCHAR(1) DEFAULT 'N', "HandWriten" NVARCHAR(1) DEFAULT 'N', "Printed" NVARCHAR(1) DEFAULT 'N', "Transfered" NVARCHAR(1) DEFAULT 'N', "ObjType" NVARCHAR(20) DEFAULT '194' NOT NULL , "DocDate" LONGDATE CS_LONGDATE, "CardCode" NVARCHAR(15), "CreateDate" LONGDATE CS_LONGDATE, "UpdateDate" LONGDATE CS_LONGDATE, "DocDueDate" LONGDATE CS_LONGDATE, "Series" INTEGER CS_INT DEFAULT 0 NOT NULL , "Segment" SMALLINT CS_INT DEFAULT 0, "CntctCode" INTEGER CS_INT, "VatDate" LONGDATE CS_LONGDATE, "Comments" NVARCHAR(254), "TrnspCode" SMALLINT CS_INT DEFAULT -1, "ShipToCode" NVARCHAR(50), "Address" NVARCHAR(254), "Address2" NVARCHAR(254), "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "CurSource" NVARCHAR(1) DEFAULT 'C', "DocCur" NVARCHAR(3), "UserSign" SMALLINT CS_INT, "UserSign2" SMALLINT CS_INT, "NumAtCard" NVARCHAR(200), "CardName" NVARCHAR(200), "CancelDate" LONGDATE CS_LONGDATE, "DocTotal" DECIMAL(21,6) CS_FIXED, "VatSum" DECIMAL(21,6) CS_FIXED, "PayRefNo" NVARCHAR(16), "PayRefDate" LONGDATE CS_LONGDATE, "TaxMethod" NVARCHAR(1) DEFAULT 'S', "AtcEntry" INTEGER CS_INT, "IsDpm" NVARCHAR(1) DEFAULT 'N', "AltRev" INTEGER CS_INT DEFAULT 0 NOT NULL , "PIndicator" NVARCHAR(10) NOT NULL , "TransId" INTEGER CS_INT, "JrnlMemo" NVARCHAR(254), "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(200), "VATRegNum" NVARCHAR(32), "GovContrID" NVARCHAR(254), "DPPStatus" NVARCHAR(1) DEFAULT 'N', "EncryptIV" NVARCHAR(100), PRIMARY KEY ("DocEntry", "LogInstanc", "ObjType")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE CPBTREE INDEX "ATXI_NUM" ON "SBODEMOUS"."ATXI" ( "DocNum" ASC, "AltRev" ASC, "LogInstanc" ASC, "ObjType" ASC, "PIndicator" ASC, "Series" ASC )