Configuration Files

From Recital Documentation Wiki
Jump to: navigation, search

Recital products can be configured using Environment Variables and Recital SET COMMANDS.

System-wide Configuration Files

The following configuration files are installed in the <path>/conf directory and are called in this order:

recital.conf

Environment variables for all Recital products. For a sample and links to relevant environment variables, please see recital.conf.

Note: <path>/conf/recital.conf is a symbolic link to /etc/recital.d/recital.conf

config.db

Set commands that apply to all Recital products. For a sample and links to relevant set commands, please see config.db.


To allow different settings for the Recital Server (ISSERVER() = .T.) and Recital (ISSERVER() = .F.), separate them in the IF block:

if isserver()
    set...
else
    set...
endif

If you are upgrading from an earlier version of Recital or the Recital Server which had custom settings in their respective config.db files, these can be added here.

compat.db

SET FILETYPE and SET COMPATIBLE settings that apply to all Recital products. Similarly these can have different values for the Recital Server and Recital if an 'IF ISSERVER(); ELSE; ENDIF' block is used. This combines the previous unixdeveloper/compat.db and uas/compat.db files.

Note: Set commands that are affected by SET COMPATIBLE (e.g. SET PCKEYS) should be issued after the SET COMPATIBLE setting.

Local configuration files

config.db

Recital will also pick up the SET COMMAND settings from a file named config.db in the session/application start directory.

sysodbc.ini

These files contain logical view definitions and are created and modified by the SQL CREATE VIEW command.

A view is a logical table that allows you to access data from other tables. A view itself contains no data.

// SQL CREATE VIEW program
OPEN DATABASE southwind
CREATE VIEW overten AS SELECT * FROM order_details WHERE unitprice > 10
// END

When the view is created, the view definition is written into the sysodbc.ini file in the current directory or the current database if one is active. If no sysodbc.ini file currently exists, it will be created.

// Resulting sysobdc.ini contents in southwind database directory
[overten]
select=SELECT * FROM order_details WHERE unitprice > 10
// END

The data extracted from the view is the data current at the time of the SELECT statement, not at the time of the view creation.

// Extract data program
OPEN DATABASE southwind
SELECT productid, unitprice FROM overten
// END

The DROP VIEW command removes the view definition from this file. The view will be available until the DROP VIEW command is issued or the sysodbc.ini file is manually modified using a text editor.

// SQL CREATE VIEW program
OPEN DATABASE southwind
DROP VIEW overten
// END

sysodbc.ini files for single indexes

Sysodbc.ini files can also be used to specify single index files (ndx/idx/ntx) for use with SQL commands. For databases (OPEN DATABASE), the sysodbc.ini file will go in the database's directory. Otherwise the sysodbc.ini file goes in the working directory. The sysodbc.ini file is a text file and has the following format:

[<alias1>]
datafile=<table file name>
index=<first file index name>
index=<second file index name>
index...
[<alias2>]
datafile=<table file name>
index=<first file index name>
index=<second file index name>
index...

So, if the tables are in the current directory:

[customers]
datafile=customers.dbf
index1=customers1.ndx
index2=customers2.ndx
[orders]
datafile=orders.dbf
index1=orders.ndx

If the tables are not in the current directory, include the full path with the file names.