DB - set database path

SYNOPSIS

<DB = "path">


DESCRIPTION
DB sets the database path used by SQL statements in the Vortex script. It can be either a directive or a command. As a directive, it appears before the first function, and sets the starting database for the script. All SQL operations, including state-table information, are done with this database by default.

If the script needs to change databases at run time, DB can be given as a command, inside a function. This changes the database for all future <SQL> calls (but not for state-table information, which needs to be read before the script runs). However, because of the global nature of a directive, DB is generally only set at the top of a script as a directive.

Also, the database used by a single <SQL> statement may be changed with the DB option to <SQL> (here), which overrides the database path for that statement only, without changing it for future statements.

If no DB directive or command has been executed by the time a database-accessing function is encountered (e.g. SQL), the default database is opened: /usr/local/morph3/texis/testdb (under Windows, c:\morph3\texis\testdb). In version 2.6.922900000 19990401 and later, this default can be set in the texis.ini config file (see here).


EXAMPLE

<DB = "/usr/local/mydb">
<SQL "select Title from book">
  $Title
</SQL>


CAVEATS
The database given by DB is used by all SQL operations, including saving of EXPORT variables. If it is changed at run time, however, state info is still saved to the original (directive or default) database.


SEE ALSO
SQL, vxinfo


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.