run-sql.pl - Man Page

Run SQL

Synopsis

  run-sql.pl "select * from mytable where 1=0"

  run-sql.pl --sql create-table.sql

  echo "select * from mytable where 1=0" | run-sql.pl

Abstract

This sets up the database. The following options are recognized:

Options

--user USERNAME
--password PASSWORD
--dsn DSN

The DBI DSN to use for connecting to the database

--sql SQLFILE

The alternative SQL file to use instead of what is passed on the command line.

--quiet

Output no headers for empty SELECT resultsets

--bool

Set the exit code to 1 if at least one result row was found

--string

Output the (single) column that the query returns as a string without any headers

--format formatter

Use a different formatter for table output. Supported formatters are

  tab - output results as tab delimited columns

  Text::Table - output results as ASCII table

  Text::Table::Any - output results as various formats
--force

Don't stop on errors

--help

Show this message.

Info

2021-01-27 perl v5.32.1 User Contributed Perl Documentation