CREATE COLUMN TABLE "SBODEMODE"."OCRH" ("AbsId" INTEGER CS_INT NOT NULL , "CreditCard" SMALLINT CS_INT DEFAULT 0, "CrdCardNum" NVARCHAR(254), "CardValid" LONGDATE CS_LONGDATE, "VoucherNum" NVARCHAR(27), "OwnerIdNum" NVARCHAR(15), "OwnerPhone" NVARCHAR(50), "CrTypeCode" SMALLINT CS_INT, "NumOfPmnts" SMALLINT CS_INT DEFAULT 1, "PayDate" LONGDATE CS_LONGDATE, "FirstSum" DECIMAL(21,6) CS_FIXED, "AddPmntSum" DECIMAL(21,6) CS_FIXED, "CreditSum" DECIMAL(21,6) CS_FIXED, "CreditCurr" NVARCHAR(3), "CreditRate" DECIMAL(21,6) CS_FIXED, "ConfNum" NVARCHAR(20), "CreditType" NVARCHAR(1) DEFAULT 'S', "CreditDps" NVARCHAR(1) DEFAULT 'Y', "Deposited" NVARCHAR(1) DEFAULT 'N', "DeposDate" LONGDATE CS_LONGDATE, "RctAbs" INTEGER CS_INT, "DepNum" INTEGER CS_INT, "AcctCode" NVARCHAR(15), "CreditAcct" NVARCHAR(15), "CardCode" NVARCHAR(15), "Canceled" NVARCHAR(1) DEFAULT 'N', "Storno" NVARCHAR(1) DEFAULT 'N', "RcptLineId" INTEGER CS_INT, "Recived" DECIMAL(21,6) CS_FIXED, "Converted" NVARCHAR(1) DEFAULT 'N', "ConvertTo" NVARCHAR(15), "Transfered" NVARCHAR(1) DEFAULT 'N', "Instance" SMALLINT CS_INT DEFAULT 0 NOT NULL , "UserSign" SMALLINT CS_INT, "TransRef" NVARCHAR(20), "CreateDate" LONGDATE CS_LONGDATE, "ConsolNum" INTEGER CS_INT DEFAULT -1, "Project" NVARCHAR(20), "CardName" NVARCHAR(200), "EnOwnerId" NCLOB MEMORY THRESHOLD 1000, "EncryptIV" NVARCHAR(100), "VersionNum" NVARCHAR(13), PRIMARY KEY ("AbsId", "Instance")) UNLOAD PRIORITY 5  AUTO MERGE ;
ALTER TABLE "SBODEMODE"."OCRH" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$RctAbs$RcptLineId$Storno$','RctAbs','RcptLineId','Storno'));
ALTER TABLE "SBODEMODE"."OCRH" WITH PARAMETERS ('CONCAT_ATTRIBUTE'=('$VoucherNum$CreditCard$Storno$','VoucherNum','CreditCard','Storno'));
CREATE INDEX "OCRH_CRED_CARD" ON "SBODEMODE"."OCRH" ( "CreditCard" ASC );
CREATE INDEX "OCRH_CRED_TYPE" ON "SBODEMODE"."OCRH" ( "CreditType" ASC );
CREATE INDEX "OCRH_RECEIPT" ON "SBODEMODE"."OCRH" ( "RctAbs" ASC, "RcptLineId" ASC, "Storno" ASC );
CREATE INDEX "OCRH_CUST_CODE" ON "SBODEMODE"."OCRH" ( "CardCode" ASC );
CREATE INDEX "OCRH_DEP_ABS" ON "SBODEMODE"."OCRH" ( "DepNum" ASC );
CREATE INDEX "OCRH_IS_VALID" ON "SBODEMODE"."OCRH" ( "VoucherNum" ASC, "CreditCard" ASC, "Storno" ASC );
CREATE INDEX "OCRH_CRED_ACCT" ON "SBODEMODE"."OCRH" ( "CreditAcct" ASC )