Difference between revisions of "Configuration Files"

From Recital Documentation Wiki
Jump to: navigation, search
(compat.db)
 
(12 intermediate revisions by one user not shown)
Line 1: Line 1:
{{YLM add 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 for all Recital products.  Note: this is a symoblic link to ''/etc/recital.d/recital.conf''
+
Environment variables for all Recital products.  For a sample and links to relevant [[:Category:Environment Variables|environment variables]], please see [[recital.conf]].
  
 +
Note: ''<path>/conf/recital.conf'' is a symbolic link to ''/etc/recital.d/recital.conf''
  
 
====config.db====
 
====config.db====
SET COMMANDS that apply to all Recital products.  To allow different settings for the Recital Server ([[ISSERVER()]] = .T.) and Recital ([[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 or the Recital Server which had custom settings in their respective config.db files, these can be added here.
Line 29: Line 28:
 
[[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.
 
[[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==
  
====config.db and profile.db====
+
====config.db====
Recital will also pick up the settings from files named config.db (SET COMMANDS) or profile.db (Environment Variables) in the session/application start directory.
+
Recital will also pick up the SET COMMAND settings from a file named config.db in the session/application start directory.
  
 
====sysodbc.ini====
 
====sysodbc.ini====
Line 42: Line 42:
 
<code lang="recital">
 
<code lang="recital">
 
// SQL CREATE VIEW program
 
// SQL CREATE VIEW program
EXEC SQL
+
OPEN DATABASE southwind
OPEN DATABASE southwind;
+
CREATE VIEW overten AS SELECT * FROM order_details WHERE unitprice > 10
EXEC SQL
+
CREATE VIEW overten AS SELECT * FROM order_details WHERE unitprice > 10;
+
 
// END
 
// END
 
</code>
 
</code>
Line 54: Line 52:
 
// Resulting sysobdc.ini contents in southwind database directory
 
// Resulting sysobdc.ini contents in southwind database directory
 
[overten]
 
[overten]
select=SELECT * FROM order_details WHERE unitprice > 10;
+
select=SELECT * FROM order_details WHERE unitprice > 10
 
// END
 
// END
 
</code>
 
</code>
Line 62: Line 60:
 
<code lang="recital">
 
<code lang="recital">
 
// Extract data program
 
// Extract data program
EXEC SQL
+
OPEN DATABASE southwind
OPEN DATABASE southwind;
+
SELECT productid, unitprice FROM overten
EXEC SQL
+
SELECT productid, unitprice FROM overten;
+
 
// END
 
// END
 
</code>
 
</code>
Line 73: Line 69:
 
<code lang="recital">
 
<code lang="recital">
 
// SQL CREATE VIEW program
 
// SQL CREATE VIEW program
EXEC SQL
+
OPEN DATABASE southwind
OPEN DATABASE southwind;
+
DROP VIEW overten
EXEC SQL
+
DROP VIEW overten;
+
 
// END
 
// END
 
</code>  
 
</code>  
Line 112: Line 106:
 
[[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.