CREATE COLUMN TABLE "SBODEMOPT"."OTXD" ("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, "CurSource" NVARCHAR(1) DEFAULT 'C', "DocCur" NVARCHAR(3), "UserSign" SMALLINT CS_INT, "UserSign2" SMALLINT CS_INT, "NumAtCard" NVARCHAR(100), "CardName" NVARCHAR(100), "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(100), "VATRegNum" NVARCHAR(32), "GovContrID" NVARCHAR(254), "DPPStatus" NVARCHAR(1) DEFAULT 'N', "EncryptIV" NVARCHAR(100), PRIMARY KEY ("DocEntry", "ObjType")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "OTXD_NUM" ON "SBODEMOPT"."OTXD" ( "DocNum" ASC, "AltRev" ASC, "ObjType" ASC, "PIndicator" ASC, "Series" ASC )