1 min read

Update MDS_RECNUM Automatically

The BTR2SQL Data Migration Utility adds the auto-increment field MDS_RECNUM as the first column of each migrated table. An extract of a migration trace is shown below:

21:51:31.078> btr2SQL.exe: Converting Billing
21:51:31.218> PrimaryKey set to recnum
21:51:32.406> SQL_FOR_SET Defined for: DemoData.dbo.BILLING
21:51:32.406> Creating new table (BILLING) at 'c:pvswdemodatabilling.mkd'
21:51:32.406> RecSize=139; 7 fields, 1 indexes.
21:51:32.406> BeginTransaction [Exclusive]: sqlsrv
21:51:32.421> CREATE TABLE "DemoData"."dbo"."BILLING" (MDS_RECNUM DECIMAL(28,0) NOT NULL IDENTITY(1,1), "STUDENT_ID" BIGINT DEFAULT 0 NOT NULL, "TRANSACTION_NUMBER" INT DEFAULT 0 NOT NULL, "LOG" VARCHAR(20) NOT NULL, "AMOUNT_OWED" DECIMAL(13,2) NULL, "AMOUNT_PAID" DECIMAL(13,2) NULL, "REGISTRAR_ID" BIGINT DEFAULT 0 NOT NULL, "COMMENTS" VARCHAR(100) NULL)

 

If you are using Mertech’s drivers with your Btrieve program, Mertech’s drivers automatically handle the auto increment values.  However, if you access and change the same table by a non-Btrieve program, then the auto-increment sequence is disturbed.  To avoid this, enable a trigger that automatically fires when a record is added, deleted, or updated and perform the necessary operations for auto-increment handling.


To enable the trigger:

  1. Select the required file.

  2. <Right-click> and select Oracle Specific Options | Enable Trigger to Handle Auto-Increment and Inverse Key.

 

Data Security with Flex2SQL and BTR2SQL Connectivity Products

Data Security with Flex2SQL and BTR2SQL Connectivity Products

The most common reason for Enterprises looking to migrate from legacy Btrieve or DataFlex databases is the urgent need to address security and...

Read More
Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Why Migrate from Btrieve to PostgreSQL and other Relational Databases?

Introduction Many independent software vendors (ISV) and corporate users still rely on applications that use a category of database collective called...

Read More
Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

Four Challenges in Converting COBOL Applications from ISAM Databases to Relational Databases

COBOL applications are the foundation of numerous essential business functions, especially within the banking, insurance, and government sectors....

Read More