On this page
LIB RUN
Runs a Script from the Scripts Library.
Syntax
LIB RUN <script> [<name>=<value> ...]
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<script> | Yes | A path relative to the Scripts Library root, exactly as written; no extension is added | None |
<name>=<value> | No, unless the Script requires it | A named argument: a number, a quoted string, TRUE, FALSE, NULL or ${variable} | For a -- @param parameter: the variable of that name set by LET, otherwise its default |
Examples
LIB RUN maintenance/cleanup.bsql
LIB RUN "folder/my script.bsql" region='EU' year=2026
Details
The Script
The name is a path relative to the Scripts Library root, taken exactly as written: LIB RUN foo.bsql runs foo.bsql of the library, LIB RUN maintenance/foo.bsql runs maintenance/foo.bsql. No extension is added, no alias or file name search is done, and the path cannot leave the library: use @<path> for a Script stored elsewhere. Put a path that contains spaces in double quotes.
Arguments and result
Arguments are named, as for @: LIB RUN report.bsql customer_id=42 country='FR' sets the scripting variables customer_id and country for this call, and the Script reads them as ${customer_id} and ${country}. A -- @param parameter that is not passed takes the value of the variable of the same name set by LET, otherwise its default. The positional parameters %1 to %9 were removed. The run, the arguments, the final status line and the errors are those of @; only the way the Script is named differs.
Related
- @, Scripts stored anywhere
- LIB LIST
- LIB SHOW
- Named Script arguments
- Scripts Library
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.