STILTS-SQLUPDATE(1)
π STILTS-SQLUPDATE β bestie, it's the <pink>stilts sqlupdate` era π
okay so real talk, this is stilts-sqlupdate, and it Updates values in an SQL table. that's the whole vibe. it lives in the stilts family of commands, and we're gonna walk through it together, no cap. β¨
πΈ SYNOPSIS πΈ
no thoughts, just the β¨ invocation β¨:
stilts sqlupdate [db=<jdbc-url>] [user=<value>] [password=<value>]
[select=<select-stmt>] [assign=<col>=<expr>]
[progress=true|false]
π¦ DESCRIPTION π¦
so sqlupdate goes into an existing table in an SQL database and rewrites values in it. which rows get touched? you tell it with a normal SELECT statement, handed over via the select parameter. and then every column you want to change, plus the value you want to slam into it, gets given with the assign parameter. it's giving surgical. π
now, bestie, you might be asking: why not just use the database's own UPDATE statement? and honestly? in most cases, that would be a much better idea. periodt. BUT β with sqlupdate you get to write those values using STILTS's expression language, so you can flex all its various functions without having to embed them into the database itself. and the juicy part: SQL column names can be used as variables in those expressions, in exactly the same way that table column names are used as variables in other commands like tpipe. iykyk. π
β οΈ caveat time, bestie: 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 β and obviously you'll need a database to connect to, appropriate write permissions on it, and the relevant drivers. all three. no skipping. π
also real talk: this is a somewhat specialised command, and several things can go wrong with it, and those things are database/driver-specific. if you don't have a fairly good understanding of the database you're using it with, you may run into problems. that said β if you didn't have the permissions to do the updates, you'd be unlikely to be here in the first place, so. π
π OPTIONS π
one bullet per option, let's go, we're not skipping a single one, not today:
db=<jdbc-url>β the URL that defines a connection to a database. it's shaped likejdbc:<subprotocol>:<subname>, and the details are database- and driver-dependent, so don't come for me about specifics. consult Sun's JDBC documentation plus the docs for the particular JDBC driver you're using. heads up: the relevant driver class also needs to be on your classpath and referenced in thejdbc.driverssystem property for the connection to actually be made. all the pieces, bestie. π§©user=<value>β the user name for logging in to the SQL database. defaults to the current username, cute and convenient. β¨password=<value>β the password for logging in to the SQL database. no default. it's giving mystery. πselect=<select-stmt>β hands over the full text (yes, including the word"SELECT") of theSELECTstatement that identifies which rows undergo updates. full text. did i stutter. πassign=<col>=<expr>β assigns new values for a given column. the assignment comes 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 SUN/256. SQL table column names or$IDidentifiers may be used as variables in the usual way. π
this parameter can be supplied more than once to effect multiple assignments β or you can do multiple assignments by separating them with semicolons in the value of this parameter. your call, both slay.
progress=true|falseβ iftrue, a spinner gets drawn on standard error showing how many rows have been updated so far. little spinning friend. mesmerizing. π
π«Ά SEE ALSO π«Ά
if the package stilts-doc is installed, the full documentation SUN/256 is available in HTML format at:
file:///usr/share/doc/stilts/sun256/index.html
β VERSION β
STILTS version 3.5.4-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
π AUTHOR π
Mark Taylor (Bristol University) β legend behaviour, fr fr.
and that's the whole page, bestie!! this doc dropped way back in Mar 2017 and it's still out here doing its thing for STILTS-SQLUPDATE(1) in the Stilts commands manual. go update some tables responsibly, mwah ππΈ
π¦ where this page comes from
- ubuntu stonking: stilts 3.5.4-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms