SPFIX reads one or more files with stored procedures, user-defined functions, triggers and views and put each object in a file on its own. You can also request various changes to be made to the code.

Command-line syntax:

   spfix [-shortnames file] [-upcase] [-cleanup] file1 [file2...]
-shortnamesFile with shortnames for tables. The format is the same for TBLFIX: one line per table, with table name followed by the shortname, with white space as a separator. You can use -- to introduce a comment.
-upcase If you specify -upcase, all SQL keywords will be cast into uppercase.
-cleanupMiscellaneous cleanup, see below.

SPFIX permits you to script out a database from Enterprise Manager, and split the objects into files on their own so that you then can put the files under source control. The input file(s) does not have to come from EM; they could come from any source.

SPFIX puts each object into a file of its own, and each file is name object.ext, where object is the name of the object and ext is .SP for stored procedures, .SQLFUN for user-defined functions, .TRI for triggers and .VIEW for views. This agrees with the AbaPerls SQL directory structure, except on one point: SPFIX places each trigger in a file on its own, but all triggers for a table should be in one file. You will have fix this yourself.

SPFIX writes all the files to the current directory.

These are the changes that SPFIX performs when it generates the files:

If you specify -cleanup, SPFIX also performs these additional changes.

(The reader may question some of these changes. Apparently at some time in the dim and distant past I had some junk code, which needed these fixes.)

SPFIX is fairly rough tool, and you should probably build an empty database with DBBUILD to find any syntax errors, and also verify with the original database that SPFIX succeeded in finding all objects in the input file(s).