CREATE COLUMN TABLE "SBODEMOPT"."AMR1" ("DocEntry" INTEGER CS_INT NOT NULL , "LineNum" INTEGER CS_INT NOT NULL , "ItemCode" NVARCHAR(50), "Dscription" NVARCHAR(200), "Quantity" DECIMAL(21,6) CS_FIXED, "Price" DECIMAL(21,6) CS_FIXED, "LineTotal" DECIMAL(21,6) CS_FIXED, "WhsCode" NVARCHAR(8), "RIncmAcct" NVARCHAR(15), "RDcrmAcct" NVARCHAR(15), "RToStock" DECIMAL(21,6) CS_FIXED, "RActPrice" DECIMAL(21,6) CS_FIXED, "ROnHand" DECIMAL(21,6) CS_FIXED, "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "ObjType" NVARCHAR(20) DEFAULT '162' NOT NULL , "EvalSystem" NVARCHAR(1), "OcrCode" NVARCHAR(8), "UnitMsr" NVARCHAR(100), "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "Project" NVARCHAR(20), PRIMARY KEY ("DocEntry", "LineNum", "LogInstanc", "ObjType")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."AMR1" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$WhsCode$','ItemCode','WhsCode'));
CREATE INDEX "AMR1_ITEM_WHS" ON "SBODEMOPT"."AMR1" ( "ItemCode" ASC, "WhsCode" ASC );
CREATE INDEX "AMR1_ITEM" ON "SBODEMOPT"."AMR1" ( "ItemCode" ASC )