CREATE COLUMN TABLE "SBODEMOPT"."UWOR" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "Series" INTEGER CS_INT DEFAULT 0, "ItemCode" NVARCHAR(50), "Status" NVARCHAR(1) DEFAULT 'P', "Type" NVARCHAR(1) DEFAULT 'S', "PlannedQty" DECIMAL(21,6) CS_FIXED, "CmpltQty" DECIMAL(21,6) CS_FIXED, "RjctQty" DECIMAL(21,6) CS_FIXED, "PostDate" LONGDATE CS_LONGDATE, "DueDate" LONGDATE CS_LONGDATE, "OriginAbs" INTEGER CS_INT, "OriginNum" INTEGER CS_INT, "OriginType" NVARCHAR(1) DEFAULT 'M', "UserSign" SMALLINT CS_INT, "Comments" NVARCHAR(254), "CloseDate" LONGDATE CS_LONGDATE, "RlsDate" LONGDATE CS_LONGDATE, "CardCode" NVARCHAR(15), "Warehouse" NVARCHAR(8), "Uom" NVARCHAR(100), "LineDirty" INTEGER CS_INT, "JrnlMemo" NVARCHAR(254), "TransId" INTEGER CS_INT, "CreateDate" LONGDATE CS_LONGDATE, "Printed" NVARCHAR(1) DEFAULT 'N', "OcrCode" NVARCHAR(8), "PIndicator" NVARCHAR(10) DEFAULT ' ' NOT NULL , "OcrCode2" NVARCHAR(8), "OcrCode3" NVARCHAR(8), "OcrCode4" NVARCHAR(8), "OcrCode5" NVARCHAR(8), "SeqCode" SMALLINT CS_INT, "Serial" INTEGER CS_INT, "SeriesStr" NVARCHAR(3), "SubStr" NVARCHAR(3), "LogInstanc" INTEGER CS_INT DEFAULT 0, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "Project" NVARCHAR(20), "SupplCode" NVARCHAR(254), "UomEntry" INTEGER CS_INT DEFAULT 0, "PickRmrk" NVARCHAR(254), "SysCloseDt" LONGDATE CS_LONGDATE, "SysCloseTm" SMALLINT CS_INT, "CloseVerNm" NVARCHAR(13), "StartDate" LONGDATE CS_LONGDATE, "ObjType" NVARCHAR(20) DEFAULT '202', "ProdName" NVARCHAR(200), "Priority" SMALLINT CS_INT DEFAULT 100, "RouDatCalc" NVARCHAR(1) DEFAULT 'S', "UpdAlloc" NVARCHAR(1) DEFAULT 'M', "CreateTS" INTEGER CS_INT, "UpdateTS" INTEGER CS_INT, "VersionNum" NVARCHAR(13), "DataSource" NVARCHAR(1) DEFAULT 'N', "SAPPassprt" NCLOB MEMORY THRESHOLD 1000, "AtcEntry" INTEGER CS_INT, "Attachment" NCLOB MEMORY THRESHOLD 1000, "AsChild" NVARCHAR(1) DEFAULT 'N', "LinkToObj" NVARCHAR(20) DEFAULT '17', "ProcItms" NVARCHAR(1) DEFAULT 'N', "ReopOriDoc" NVARCHAR(1), PRIMARY KEY ("DocEntry")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "UWOR_NUM" ON "SBODEMOPT"."UWOR" ( "DocNum" ASC, "PIndicator" ASC );
CREATE INDEX "UWOR_ITEM_CODE" ON "SBODEMOPT"."UWOR" ( "ItemCode" ASC )