1RUN-SQL(1) User Contributed Perl Documentation RUN-SQL(1)
2
3
4
6 run-db.pl - Run SQL
7
9 run-sql.pl "select * from mytable where 1=0"
10
11 run-sql.pl --sql create-table.sql
12
13 echo "select * from mytable where 1=0" | run-sql.pl
14
16 This sets up the database. The following options are recognized:
17
19 "--user" USERNAME
20 "--password" PASSWORD
21 "--dsn" DSN
22 The DBI DSN to use for connecting to the database
23
24 "--sql" SQLFILE
25 The alternative SQL file to use instead of what is passed on the
26 command line.
27
28 "--quiet"
29 Output no headers for empty SELECT resultsets
30
31 "--bool"
32 Set the exit code to 1 if at least one result row was found
33
34 "--string"
35 Output the (single) column that the query returns as a string
36 without any headers
37
38 "--format" formatter
39 Use a different formatter for table output. Supported formatters
40 are
41
42 tab - output results as tab delimited columns
43
44 Text::Table - output results as ASCII table
45
46 Text::Table::Any - output results as various formats
47
48 "--force"
49 Don't stop on errors
50
51 "--help"
52 Show this message.
53
54
55
56perl v5.30.1 2020-01-29 RUN-SQL(1)