CREATE COLUMN TABLE "SBODEMOPT"."ASRN" ("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 NOT NULL , "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", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMOPT"."ASRN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$DistNumber$','ItemCode','DistNumber'));
ALTER TABLE "SBODEMOPT"."ASRN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$LotNumber$','ItemCode','LotNumber'));
CREATE UNIQUE CPBTREE INDEX "ASRN_SYSTEM_KEY" ON "SBODEMOPT"."ASRN" ( "ItemCode" ASC, "SysNumber" ASC, "LogInstanc" ASC );
CREATE CPBTREE INDEX "ASRN_DIST_KEY" ON "SBODEMOPT"."ASRN" ( "ItemCode" ASC, "DistNumber" ASC );
CREATE CPBTREE INDEX "ASRN_LOT_KEY" ON "SBODEMOPT"."ASRN" ( "ItemCode" ASC, "LotNumber" ASC )