CREATE COLUMN TABLE "SBODEMOPT"."USRN" ("ItemCode" NVARCHAR(50) NOT NULL , "SysNumber" INTEGER CS_INT NOT NULL , "DistNumber" NVARCHAR(36), "MnfSerial" NVARCHAR(36), "LotNumber" NVARCHAR(36), "ExpDate" LONGDATE CS_LONGDATE, "MnfDate" LONGDATE CS_LONGDATE, "InDate" LONGDATE CS_LONGDATE, "GrntStart" LONGDATE CS_LONGDATE, "GrntExp" LONGDATE CS_LONGDATE, "CreateDate" LONGDATE CS_LONGDATE, "Location" NVARCHAR(100), "Status" NVARCHAR(1), "Notes" NCLOB MEMORY THRESHOLD 1000, "DataSource" NVARCHAR(1) DEFAULT 'N', "UserSign" SMALLINT CS_INT, "Transfered" NVARCHAR(1) DEFAULT 'N', "Instance" SMALLINT CS_INT DEFAULT 0, "AbsEntry" INTEGER CS_INT NOT NULL , "ObjType" NVARCHAR(20), "itemName" NVARCHAR(200), "LogInstanc" INTEGER CS_INT, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "CostTotal" DECIMAL(21,6) CS_FIXED, "Quantity" DECIMAL(21,6) CS_FIXED, "QuantOut" DECIMAL(21,6) CS_FIXED, "PriceDiff" DECIMAL(21,6) CS_FIXED, "Balance" DECIMAL(21,6) CS_FIXED, "TrackingNt" INTEGER CS_INT, "TrackiNtLn" INTEGER CS_INT, "SumDec" SMALLINT CS_INT, PRIMARY KEY ("AbsEntry")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."USRN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$DistNumber$','ItemCode','DistNumber'));
ALTER TABLE "SBODEMOPT"."USRN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$LotNumber$','ItemCode','LotNumber'));
CREATE UNIQUE INDEX "USRN_SYSTEM_KEY" ON "SBODEMOPT"."USRN" ( "ItemCode" ASC, "SysNumber" ASC );
CREATE INDEX "USRN_DIST_KEY" ON "SBODEMOPT"."USRN" ( "ItemCode" ASC, "DistNumber" ASC );
CREATE INDEX "USRN_LOT_KEY" ON "SBODEMOPT"."USRN" ( "ItemCode" ASC, "LotNumber" ASC )