Difference between revisions of "Configuration Files"

From Recital Documentation Wiki
Jump to: navigation, search
(compat.db)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{YLM add sysodbc.ini and recital.ini(?)}}
 
 
 
Recital products can be configured using [[:Category:Environment Variables|Environment Variables]] and Recital [[:Category:Set_Commands|SET COMMANDS]].
 
Recital products can be configured using [[:Category:Environment Variables|Environment Variables]] and Recital [[:Category:Set_Commands|SET COMMANDS]].
 
  
 
==System-wide Configuration Files==
 
==System-wide Configuration Files==
The following configuration files are installed in the <path>/conf directory:
+
The following configuration files are installed in the <path>/conf directory and are called in this order:
  
 
====recital.conf====
 
====recital.conf====
Environment variables that apply to all Recital products.
+
Environment variables for all Recital products.  For a sample and links to relevant [[:Category:Environment Variables|environment variables]], please see [[recital.conf]].
  
====db.conf====
+
Note: ''<path>/conf/recital.conf'' is a symbolic link to ''/etc/recital.d/recital.conf''
Environment variables that apply to Recital Terminal Developer and supersede ones in recital.conf. If you are upgrading from an earlier version of Recital Terminal Developer which had custom settings in the profile.db file, these can be added here.
+
 
+
====dbserver.conf====
+
Environment variables that apply to the Recital Server (RDS/UAS) and supersede ones in recital.conf. If you are upgrading from an earlier version of the Recital Server which had custom settings in the profile.uas file, these can be added here.
+
  
 
====config.db====
 
====config.db====
SET COMMANDS that apply to all Recital products.  To allow different settings for the Recital Server ([[ISSERVER()]] = .T.) and Recital Terminal Developer ([[ISSERVER()]] = .F.), separate them in the [[IF]] block:
+
Set commands that apply to all Recital products.  For a sample and links to relevant [[:Category:Set Commands|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:
  
 
<code lang="recital">
 
<code lang="recital">
 
if isserver()
 
if isserver()
...
+
    set...
 
else
 
else
...
+
    set...
 
endif
 
endif
 
</code>
 
</code>
  
 
+
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.
If you are upgrading from an earlier version of Recital Terminal Developer or the Recital Server which had custom settings in their respective config.db files, these can be added here.
+
  
 
====compat.db====
 
====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 Terminal Developer if an '[[IF]] [[ISSERVER()]]; [[IF|ELSE]]; [[IF|ENDIF]]' block is used.  This combines the previous unixdeveloper/compat.db and uas/compat.db files.
+
[[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()]]; [[IF|ELSE]]; [[IF|ENDIF]]' block is used.  This combines the previous unixdeveloper/compat.db and uas/compat.db files.
  
 +
Note: [[:Category:Set Commands|Set commands]] that are affected by [[SET COMPATIBLE]] (e.g. [[SET PCKEYS]]) should be issued after the [[SET COMPATIBLE]] setting.
  
 
==Local configuration files==
 
==Local configuration files==
Recital Terminal Developer will also pick up the settings from files named config.db or profile.db in the session/application start directory.
+
 
 +
====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.
 +
 
 +
<code lang="recital">
 +
// SQL CREATE VIEW program
 +
OPEN DATABASE southwind
 +
CREATE VIEW overten AS SELECT * FROM order_details WHERE unitprice > 10
 +
// END
 +
</code>
 +
 
 +
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.
 +
 
 +
<code lang="recital">
 +
// Resulting sysobdc.ini contents in southwind database directory
 +
[overten]
 +
select=SELECT * FROM order_details WHERE unitprice > 10
 +
// END
 +
</code>
 +
 
 +
The data extracted from the view is the data current at the time of the [[SQL SELECT|SELECT]] statement, not at the time of the view creation.
 +
 
 +
<code lang="recital">
 +
// Extract data program
 +
OPEN DATABASE southwind
 +
SELECT productid, unitprice FROM overten
 +
// END
 +
</code>
 +
 
 +
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.
 +
 
 +
<code lang="recital">
 +
// SQL CREATE VIEW program
 +
OPEN DATABASE southwind
 +
DROP VIEW overten
 +
// END
 +
</code>
 +
 
 +
====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:
 +
 
 +
<pre>
 +
[<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...
 +
</pre>
 +
 
 +
So, if the tables are in the current directory:
 +
 
 +
<pre>
 +
[customers]
 +
datafile=customers.dbf
 +
index1=customers1.ndx
 +
index2=customers2.ndx
 +
[orders]
 +
datafile=orders.dbf
 +
index1=orders.ndx
 +
</pre>
 +
 
 +
If the tables are not in the current directory, include the full path with the file names.
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Reference]]
 
[[Category:Reference]]
 +
[[Category:Configuration]]
 +
[[Category:RDS Configuration]]

Latest revision as of 13:19, 8 March 2012

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.