Skip to content

Code Registration

Introduction

In the modern base server framework, files such as .ddl and .dml continue to grow. This necessitates a reliable mechanism to ensure that once a code block is deployed to the database, it doesn't need to be redeployed. To address this, we introduce the code registration mechanism.

Mechanism

How It Works

The code registration system tracks changes applied to the database. By wrapping your code with an if condition, you can confirm it hasn't been executed if it was previously deployed.

Benefits

  • Efficiency: Saves time by preventing redundant deployments.
  • Integrity: Maintains database consistency.

Example Usage

Here's an example demonstrating how to use code registration to ensure a block runs only once:

BEGIN
  IF Code_Registration_SYS.Not_Registered('ACCRUL', 'AccrulCurrencyData.ins', '1', 'INS') THEN
    BEGIN
      New_Company_Type___('1', 'Normal', 'Y', '', 'NORMAL');
      New_Company_Type___('2', 'EMU currencies', 'Y', 'EUR', 'NORMAL');
      New_Company_Type___('3', 'Parallel Currency', 'N', '', 'PARALLEL_CURRENCY');
    END;
    Code_Registration_SYS.Register('ACCRUL', 'AccrulCurrencyData.ins', '1', 'INS');
  END IF;
END;

Conclusion

Code registration is a vital mechanism in database management, optimizing performance and ensuring code executability is managed efficiently.