Next Previous Up Contents
Next: Examples
Up: sqlupdate: Updates values in an SQL table
Previous: sqlupdate: Updates values in an SQL table

### B.23.1 Usage

The usage of `sqlupdate` is

       stilts <stilts-flags> sqlupdate db=<jdbc-url> user=<value> password=<value>
                                       select=<select-stmt> assign=<col>=<expr>
                                       progress=true|false

If you don't have the `stilts` script installed, write "`java -jar stilts.jar`" instead of "`stilts`" - see Section 3. The available `<stilts-flags>` are listed in Section 2.1. For programmatic invocation, the Task class for this command is `uk.ac.starlink.ttools.task.SqlUpdate`.

Parameter values are assigned on the command line as explained in Section 2.3. They are as follows:

`assign = <col>=<expr>` (Assignment[])
  Assigns new values for a given column. The assignment is made in the form `<colname>=<expr>` where `<colname>` is the name of a column in the SQL table and `<expr>` is the text of an expression using STILTS's expression language, as described in Section 10. SQL table column names or $ID identifiers may be used as variables in the usual way.

  This parameter may be supplied more than once to effect multiple assignments, or multiple assignments may be made by separating them with semicolons in the value of this parameter.

`db = <jdbc-url>` (Connection)
  URL which defines a connection to a database. This has the form `jdbc:<subprotocol>:<subname>` - the details are database- and driver-dependent. Consult Sun's JDBC documentation and that for the particular JDBC driver you are using for details. Note that the relevant driver class will need to be on your classpath and referenced in the `jdbc.drivers` system property as well for the connection to be made.
`password = <value>` (String)
  Password for logging in to SQL database.
`progress = true|false` (Boolean)
  If true, a spinner will be drawn on standard error which shows how many rows have been updated so far.

  [Default: `true`]

`select = <select-stmt>` (String)
  Gives the full text (including "`SELECT`") of the SELECT statement to identify which rows undergo updates.
`user = <value>` (String)
  User name for logging in to SQL database. Defaults to the current username.

  [Default: `mbt`]

Next Previous Up Contents
Next: Examples
Up: sqlupdate: Updates values in an SQL table
Previous: sqlupdate: Updates values in an SQL table

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk