STILTS-SQLUPDATE(1) | Stilts commands | STILTS-SQLUPDATE(1) |
stilts-sqlupdate - Updates values in an SQL table
stilts sqlupdate [db=<jdbc-url>] [user=<value>] [password=<value>] [select=<select-stmt>] [assign=<col>=<expr>] [progress=true|false]
sqlupdate updates values in an existing table in an SQL database. The rows to update are specified, as a normal SELECT statement, using the select parameter. Each column to update, and the value to write to it, are given using the assign parameter.
Why not just use the database's own UPDATE statement? In most cases, that would be a much better idea. However, using sqlupdate you can write values using STILTS's expression language, and hence take advantage of its various functions, without having to embed them into the database. SQL column names can be used as variables in these expressions, in the same way that table column names are used as variables in other commands such as tpipe.
This command can only be used if you have access to an SQL database via JDBC. The details of how to configure a JDBC connection to a database are discussed in SUN/256 - obviously you will need a database to connect to and appropriate write permissions on it as well as the relevant drivers.
This is a somewhat specialised command, and several (database/driver-specific) things can go wrong with it. If you do not have a fairly good understanding of the database with which you are using it then you may run into problems (but then you'd be unlikely to have the permissions to do the updates in any case).
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.
If the package stilts-doc is installed, the full documentation
SUN/256 is available in HTML format:
file:///usr/share/doc/stilts-doc/sun256/index.html
STILTS version 3.1-5-debian
This is the Debian version of Stilts, which lack the support of
some file formats and network protocols. For differences see
file:///usr/share/doc/stilts/README.Debian
Mark Taylor (Bristol University)
Mar 2017 |