CREATE COLUMN TABLE "SBODEMOPT"."ADO21" ("DocEntry" INTEGER CS_INT NOT NULL , "ObjectType" NVARCHAR(20) DEFAULT '0' NOT NULL , "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "RefType" NVARCHAR(1) DEFAULT 'S' NOT NULL , "LineNum" INTEGER CS_INT NOT NULL , "RefDocEntr" INTEGER CS_INT, "RefDocNum" INTEGER CS_INT, "ExtDocNum" NVARCHAR(100), "RefObjType" NVARCHAR(20), "AccessKey" NVARCHAR(100), "IssueDate" LONGDATE CS_LONGDATE, "IssuerCNPJ" NVARCHAR(100), "IssuerCode" NVARCHAR(10), "Model" NVARCHAR(6), "Series" NVARCHAR(3), "Number" INTEGER CS_INT, "RefAccKey" NVARCHAR(100), "RefAmount" DECIMAL(21,6) CS_FIXED, "SubSeries" NVARCHAR(3), "Remark" NVARCHAR(254), "LinkRefTyp" NVARCHAR(20) DEFAULT '00', PRIMARY KEY ("DocEntry", "LineNum", "LogInstanc", "ObjectType", "RefType")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE CPBTREE INDEX "ADO21_DOC_ENTRY" ON "SBODEMOPT"."ADO21" ( "DocEntry" ASC )