Section 2.6: Connect Up Chapter 2: Install Section 2.8: DECIMAL format 

2.7 aubitrc

All Aubit4GL compilers read their configuration files in this order:
  1. /etc/opt/aubit4gl/aubitrc (only if you run: make install)
  2. $AUBITDIR/etc/aubitrc
  3. ~/.aubit4gl/aubitrc
  4. ./.aubitrc
  5. $A4GL_INIFILE
Values in later files override those already set in earlier files. The aubitrc file in $AUBITDIR/etc is based on aubitrc.in and is edited to appropriate values by the configure program. To see what your current settings are run the command:
aubit-config -a
You can edit these files with a text edit program such as vi(m) or (x)emacs or you can choose to use one of the programs that Aubit4GL supplies:
quickguide is new with version 1.20 and is now the preferred method to set the environment.

2.7.1 Binary

The file $AUBITDIR/etc/aubitrc will be the one set up when Mike Aubury created the binary tarball. It will almost always be wrong for your setup. Change it. Whenever you install a binary make sure you have saved your aubitrc beforehand (e.g. in /local/etc/aubitrc or as oaubitrc in $AUBITDIR/etc) and then selectively reassert your entries from your saved aubitrc into the newly installed one. Run the diff command on the old and new and look for differences in settings. (The new one my have extra settings which you should add to the old aubitrc.

2.7.2 Source

Your new aubitrc will be built by merging a file aubitrc.in with settings the configure found. It should be close to what you want apart from things where you have a multiple choice (e.g. postgresql or sqlite3)

2.7.3 Plugins

Aubit4GL uses an abstraction layer for many of its functions. This means that the way Aubit4GL works can be controlled very tightly by the setting of various variables. These variables specify which plugins will be loaded by the compiler and/or 4GL program. At this stage you need only concern yourself with SQLTYPE and LEXTYPE. The defaults for all the other plugins will be appropriate.

2.7.3.1 Informix

export A4GL_SQLTYPE=esql
export A4GL_LEXTYPE=EC

2.7.3.2 PostgreSQL

export A4GL_SQLTYPE=pg8
export A4GL_LEXTYPE=C

2.7.3.3 MySQL

export A4GL_SQLTYPE=mysql
export A4GL_LEXTYPE=C

2.7.3.4 SQLite3

export A4GL_SQLTYPE=sqlite3
export A4GL_LEXTYPE=C
export DBPATH=$DBPATH:/path/to/sqlite3database

2.7.3.5 Others

The others will need ODBC and esqlc
export A4GL_SQLTYPE=iodbc
export A4GL_LEXTYPE=EC

2.7.4 A4GL_SQLACL

To configure all your access to databases you should populate an ACL file. By default this is:
$HOME/.aubit4gl.acl
But you can set up an alternative one and set environment variable
export A4GL_SQLACL=/path/to/file
instead.
The ACL file should contain lines with 3 fields:
dbname:username:password
The password should be in plain text but will be automatically encrypted (albeit with a somewhat weak encryption) the first time the file is read. If there is an entry in this file with the database name at the top of the 4gl file, Aubit4GL should use that username and password for the connection.
You can also assign username and password to the SQLUID and SQLPWD environment variables.
For PostgreSQL, if it is just the port you want to change - you could set PG_PORT instead.
For PostgreSQL you can set PG_HOST to a hostname. e.g.:
export PG_HOST=myhost
 Section 2.6: Connect Up Chapter 2: Install Section 2.8: DECIMAL format