CREATE COLUMN TABLE "IMCYC"."UBTN" ("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" CHAR(1) CS_FIXEDSTRING DEFAULT '0', "Notes" NCLOB MEMORY THRESHOLD 1000, "DataSource" CHAR(1) CS_FIXEDSTRING DEFAULT 'N', "UserSign" SMALLINT CS_INT, "Transfered" CHAR(1) CS_FIXEDSTRING DEFAULT 'N', "Instance" SMALLINT CS_INT DEFAULT 0, "AbsEntry" INTEGER CS_INT NOT NULL , "ObjType" NVARCHAR(20), "itemName" NVARCHAR(100), "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 "IMCYC"."UBTN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('ALLOW_NULL_AS_COMPONENT=YES', '$uc_UBTN_SYSTEM_KEY$','ItemCode','SysNumber'));
ALTER TABLE "IMCYC"."UBTN" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$ItemCode$DistNumber$','ItemCode','DistNumber'));
CREATE UNIQUE INDEX "UBTN_SYSTEM_KEY" ON "IMCYC"."UBTN" ( "ItemCode" ASC, "SysNumber" ASC );
CREATE INDEX "UBTN_DIST_KEY" ON "IMCYC"."UBTN" ( "ItemCode" ASC, "DistNumber" ASC )