Note: Documentation for Pivotal SQLFire 1.1.x is now available at http://docs.gopivotal.com/sqlfire/index.html. Please reference the docs.gopivotal.com site for the latest and most up-to-date documentation on SQLFire. The vFabric SQLFire documentation site will no longer be updated.

sqlf run

Connects to a SQLFire distributed system and executes the contents of a SQL command file. All commands in the specified file must be compatible with the interactive sqlf shell.

Syntax

sqlf run -file=<path or URL>
     [-auth-provider=<name>]
     [-bind-address=<address>]
     [-client-bind-address=<address>]
     [-client-port=<port>]
     [-encoding=<charset>]
     [-extra-conn-props=<properties>] 
     [-help] 
     [-ignore-errors]
     [-J-D<property=value>]
     [-locators=<adresses>]
     [-mcast-address=<address>]
     [-mcast-port=<port>]
     [-password[=<password>]]
     [-path=<path>]
     [-user=<username>]

This table describes options for the sqlf run command. Default values are used if you do not specify an option.

Option Description
-file

The local path of a SQL command file to execute, or a URL that links to the SQL command file. All commands in the specified file must be compatible with the interactive sqlf shell.

This argument is required.

-auth-provider Sets the authentication provider to use for peer-to-peer connections as well as client-server connections. Valid values are BUILTIN and LDAP. All other members of the SQLFire distributed system must use the same authentication provider and user definitions. If you omit this option, the connection uses no authentication mechanism. See Configuring Authentication and Authorization.
-bind-address The address to which this peer binds for receiving peer-to-peer messages. By default sqlf uses the hostname, or localhost if the hostname points to a local loopback address.
-client-bind-address

The hostname or IP address on which a SQLFire locator listens for client connections. The default is "localhost."

Use this option with -client-port to attach to a SQLFire cluster as a thin client and perform the command.

-client-port

The port on which a SQLFire locator listens for client connections. The default is 1527.

Use this option with -client-bind-address to attach to a SQLFire cluster as a thin client and perform the command.

-encoding The character set encoding of the SQL script file (-file argument). The default is UTF-8. Other possible values are: US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16. See the java.nio.charset.Charset reference for more information.
-extra-conn-props

A semicolon-separated list of properties to use when connecting to the SQLFire distributed system.

-help, --help

Display the help message for this sqlf command.

-ignore-errors Include this option to ignore any errors that may occur while executing statements in the file, and continue executing the remaining statements. If you omit this option, then sqlf immediately terminates the script's execution if an exception occurs.
-J-D<property=value> Sets Java system property to the specified value.
-locators

The list of locators as comma-separated host[port] values, used to discover other members of the distributed system.

Using -locators creates a peer client member to execute the sqlf command.

-mcast-address

The multicast address used to discover other members of the distributed system. This value is used only when the -locators option is not specified. The default multicast address is 239.192.81.1.

Use this option with -mcast-port to attach to a SQLFire cluster as a peer client and perform the command.

-mcast-port

The multicast port used to communicate with other members of the distributed system. If zero, multicast is not used for member discovery (specify -locators instead). This value is used only if the -locators option is not specified.

Valid values are in the range 0–65535, with a default value of 10334.

Use this option with -mcast-address to attach to a SQLFire cluster as a peer client and perform the command.

-password

If the servers or locators have been configured to use authentication, this option specifies the password for the user (specified with the -user option) to use for booting the server and joining the distributed system.

The password value is optional. If you omit the password, sqlf prompts you to enter a password from the console.

-path Configures the working directory for any other SQL command files executed from within the script. The -path entry is prepended to any SQL script file name executed that the script executes in a run command.
-user If the servers or locators have been configured to use authentication, this option specifies the user name to use for booting the server and joining the distributed system.

Description

Specify one of these pairs of options with the command to connect to a SQLFire Distributed system and execute a SQL command file:
  • Use both -client-bind-address and -client-port to connect to a SQLFire cluster as a thin client and perform the command.
  • Use both mcast-port and -mcast-address, or use the -locators property to connect to a SQLFire cluster as a peer client and perform the command.

The -file argument specifies the location of the SQL script file to execute. If the script file itself calls other script files using run 'filename', also consider using the -path option to specify the location of the embedded script files. If an exception occurs while executing the script, SQLF immediately stops executing script commands, unless you include the -ignore-errors option.

Examples

This command connects to a SQLFire network server running on myserver:1234 and executes commands in the ToursDB_schema.sql file:
sqlf run -file=c:\sqlfire\quickstart\ToursDB_schema.sql
     -client-bind-address=myserver -client-port=1234
This command executes the loadTables.sql script, which calls dependent scripts such as loadCOUNTRIES.sql, loadCITIES.sql, and so forth. If you execute this command outside of the directory in which the dependent scripts are located, you must specify the working directory using the -path option. For example:
sqlf run -file=c:\sqlfire\quickstart\loadTables.sql
     -path=c:\sqlfire\quickstart
     -client-bind-address=myserver -client-port=1234