CREATE COLUMN TABLE "SBODEMOPT"."AQR1" ("DocEntry" INTEGER CS_INT NOT NULL , "DocLineNum" INTEGER CS_INT NOT NULL , "ItemCode" NVARCHAR(50), "ItemName" NVARCHAR(200), "InvntryUom" NVARCHAR(100), "OnHandBef" DECIMAL(21,6) CS_FIXED, "Price" DECIMAL(21,6) CS_FIXED, "Quantity" DECIMAL(21,6) CS_FIXED, "Currency" NVARCHAR(3), "Rate" DECIMAL(21,6) CS_FIXED, "IOffIncAcc" NVARCHAR(15), "DOffDecAcc" NVARCHAR(15), "OcrCode" NVARCHAR(8), "WhsCode" NVARCHAR(8), "DocTotal" DECIMAL(21,6) CS_FIXED, "DocTotalFC" DECIMAL(21,6) CS_FIXED, "DocTotalSy" DECIMAL(21,6) CS_FIXED, "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "ObjType" NVARCHAR(20) DEFAULT '10000071', "Project" NVARCHAR(20), "BarCode" NVARCHAR(254), "InvUoM" NVARCHAR(1) DEFAULT 'Y', "BinEntry" INTEGER CS_INT, "FirmCode" SMALLINT CS_INT, "SuppCatNum" NVARCHAR(50), "CardCode" NVARCHAR(15), "CountDate" LONGDATE CS_LONGDATE, "CountTime" INTEGER CS_INT, "DiffPercnt" DECIMAL(21,6) CS_FIXED, "BaseRef" NVARCHAR(16), "BaseType" INTEGER CS_INT DEFAULT 1470000065, "BaseEntry" INTEGER CS_INT, "BaseLine" INTEGER CS_INT, "CountQty" DECIMAL(21,6) CS_FIXED, "Remark" NVARCHAR(254), "LogInstanc" INTEGER CS_INT NOT NULL , "CpyCount" INTEGER CS_INT DEFAULT 0, "BinNegQty" NVARCHAR(1) DEFAULT 'N', "VisOrder" INTEGER CS_INT, "UgpEntry" INTEGER CS_INT, "IUomEntry" NVARCHAR(20), "UomCode" NVARCHAR(20), "ItmsPerUnt" DECIMAL(21,6) CS_FIXED, "UomQty" DECIMAL(21,6) CS_FIXED, "ActPrice" DECIMAL(21,6) CS_FIXED, "PostValueL" DECIMAL(21,6) CS_FIXED, "PostValueS" DECIMAL(21,6) CS_FIXED, PRIMARY KEY ("DocEntry", "DocLineNum", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE INDEX "AQR1_ITEM_CODE" ON "SBODEMOPT"."AQR1" ( "ItemCode" ASC )