LIB RUN

Core command LI RU LIRU

Executes a SQL query stored in the queries library

Arguments

<queryFileName> (mandatory) the name of the file, path is not required. Default extension is SQL

Examples

LIB RUN COUNTRY.SQL

Notes

Runs a saved query from the SQL library: LIB RUN <queryFileName> [param1 param2 ...].

queryFileName is mandatory; if it has no .sql extension, one is appended automatically. The file's content is read from the configured library folder (SqlLib in BroadSQL.ini), echoed to the console, and executed - as a SELECT if it isn't recognized as an update statement, as an update otherwise.

The stored query may contain positional placeholders %1 to %9, replaced by the extra arguments given after the file name, in order (e.g. LIB RUN MYQUERY.SQL CH 800 replaces %1 with CH and %2 with 800). If any placeholder is still present after substitution, the command reports that not enough parameters were given and does not run the query. The <@file> macro syntax (see HELP) is only expanded for SELECT-type queries, not for updates.

Last modified in release 5.0.7.