SQL Standards

ACS Documentation : ACS Engineering Standards : SQL Standards

New in ACS4

ACS General Standards

SQL File Conventions

  1. Put all SQL files in /packages/<package-key>/sql/

  2. Create one (and only one) -create.sql file, called <package-key>-create.sql file in that directory. The APM will automatically try to load any -create.sql file, so only include one.

  3. Have this file source all other .sql files in the /sql directory by including @@ filename in the .sql file. @@ means load this file in the directory that the current file is located. So, if you want to load a file called demo.sql, just do:
          @@ demo.sql
          

Data Modeling

Be certain that there are no circular dependencies in your .sql files. One way to reduce these is to separate package declarations from package bodies and make sure that the package declarations get loaded first. A nice convention is to put all packages in -packages.sql, so that a programmer can easily scan a single file to check the PL/SQL API.

SQL

  • select * from... is almost always trouble - the only place it might be useful is for views, and seldom even then. Specify column names explicitly.

  • Formatting and style must be consistent.

  • acs-docs@arsdigita.com
    Last Modified: sql-standards.html,v 1.2 2001/02/26 20:41:05 bquinn Exp