CREATE COLUMN TABLE "SBODEMODE"."AFAR" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "Series" INTEGER CS_INT, "PostDate" LONGDATE CS_LONGDATE, "AssetDate" LONGDATE CS_LONGDATE, "Ref" NVARCHAR(32), "Comments" NVARCHAR(254), "JrnlMemo" NVARCHAR(254), "DprArea" NVARCHAR(15), "TransId" INTEGER CS_INT, "Handwrtten" NVARCHAR(1) DEFAULT 'N', "PIndicator" NVARCHAR(10) NOT NULL , "DocDate" LONGDATE CS_LONGDATE, "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(200), "VatRegNum" NVARCHAR(32), "RevalPerc" DECIMAL(21,6) CS_FIXED, "IfrsPsting" NVARCHAR(1) DEFAULT 'N', "PrjSmarz" NVARCHAR(1) DEFAULT 'N', "DstRlSmarz" NVARCHAR(1) DEFAULT 'N', "VersionNum" NVARCHAR(13), "DataSource" NVARCHAR(1) DEFAULT 'N', "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "UserSign2" SMALLINT CS_INT, PRIMARY KEY ("DocEntry", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE CPBTREE INDEX "AFAR_INDEX" ON "SBODEMODE"."AFAR" ( "DocNum" ASC, "PIndicator" ASC, "LogInstanc" ASC )