CREATE COLUMN TABLE "SBODEMOPT"."OACQ" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "Series" INTEGER CS_INT, "PeriodCat" NVARCHAR(10), "FinncPriod" INTEGER CS_INT, "PostDate" LONGDATE CS_LONGDATE, "DocDate" LONGDATE CS_LONGDATE, "DocStatus" NVARCHAR(1) DEFAULT 'P', "TransId" INTEGER CS_INT, "Comments" NVARCHAR(254), "Reference" NVARCHAR(32), "ObjType" NVARCHAR(20), "Currency" NVARCHAR(3), "DocRate" DECIMAL(21,6) CS_FIXED, "SysRate" DECIMAL(21,6) CS_FIXED, "PIndicator" NVARCHAR(10) NOT NULL , "DocTotal" DECIMAL(21,6) CS_FIXED, "DocTotalFC" DECIMAL(21,6) CS_FIXED, "DocTotalSy" DECIMAL(21,6) CS_FIXED, "DataSource" NVARCHAR(1) DEFAULT 'N', "UserSign" SMALLINT CS_INT, "LogInstanc" INTEGER CS_INT DEFAULT 0, "CreateDate" LONGDATE CS_LONGDATE, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "TransType" NVARCHAR(20) DEFAULT '-1', "CreatedBy" INTEGER CS_INT, "JrnlMemo" NVARCHAR(254), "AssetDate" LONGDATE CS_LONGDATE, "CurSource" NVARCHAR(1) DEFAULT 'L', "DocType" NVARCHAR(15) DEFAULT 'PL', "PrjSmarz" NVARCHAR(1) DEFAULT 'N', "DstRlSmarz" NVARCHAR(1) DEFAULT 'N', "ManDprType" NVARCHAR(15), "Handwrtten" NVARCHAR(1) DEFAULT 'N', "CancelDate" LONGDATE CS_LONGDATE, "DprArea" NVARCHAR(15), "BPLId" INTEGER CS_INT, "BaseRef" NVARCHAR(11), "LVARetire" NVARCHAR(1) DEFAULT 'N', "CancelOpt" SMALLINT CS_INT DEFAULT 1, "BPLName" NVARCHAR(200), "VatRegNum" NVARCHAR(32), "GdsMovType" NVARCHAR(2), "PTICode" NVARCHAR(5), "Letter" NVARCHAR(1), "FolNumFrom" INTEGER CS_INT, "FolNumTo" INTEGER CS_INT, "FolSeries" INTEGER CS_INT, "VersionNum" NVARCHAR(13), PRIMARY KEY ("DocEntry")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."OACQ" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$TransType$CreatedBy$','TransType','CreatedBy'));
CREATE UNIQUE CPBTREE INDEX "OACQ_INDEX" ON "SBODEMOPT"."OACQ" ( "DocNum" ASC, "PIndicator" ASC );
CREATE CPBTREE INDEX "OACQ_TRANS_TYPE" ON "SBODEMOPT"."OACQ" ( "TransType" ASC, "CreatedBy" ASC )