|isql(1)||unixODBC manual pages||isql(1)|
The tools provide several useful features, including an option to generate output wrapped in an HTML table.
iusql is the same as isql but includes built-in Unicode support. Some data sources only work with iusql.
When searching the configuration files, unixODBC looks for a bare name. If the DSN begins with a semicolon, it is treated as a connection string. The connection string can contain a DSN and/or other semicolon-separated parameters.
This parameter overrides any UID specified in the data source configuration files.
This parameter overrides any PASSWORD specified in the data source configuration files.
$ iusql WebDB MyID MyPWD -w -b < My.sql
Connects to the WebDB DSN as user MyID with password MyPWD, then executes the commands in the My.sql file and returns the results wrapped in an HTML table.
Each line in My.sql must only contain one SQL command, except for the last line, which must be blank (unless the -n option is specified).
Note the leading semicolon on the connection string.
$ iusql ";DSN=WebDB" MyID MyPWD -w -b < My.sql
Options in the DSN may be overridden in the connection string:
$ iusql ";DSN=WebDB;Driver=PostgreSQL ODBC;UID=MyID;PASSWORD=secret;Debug=1;CommLog=1" -v
A string DSN may be provided in its entirety, with no file DSN reference at all:
$ iusql ";Driver=PostgreSQL Unicode;UID=MyID;PASSWORD=secret" -v
Re-run isql or iusql with the -v flag to get more information from errors, and/or enable Trace mode in odbcinst.ini.
Check that the driver name specified by the Driver entry in the odbc.ini data-source definition is present in odbcinst.ini and exactly matches the odbcinst.ini [section name].
If the ODBC driver is properly specified for the data source, it is possible that the driver is not loadable. Check for mix-ups between Unicode and ANSI drivers, and verify the driver paths in the odbcinst.ini [section name].
Some data sources are Unicode-only and require the use of iusql. If isql reports
[IM002][unixODBC][Driver Manager]Data source name not found and no default driver specified [ISQL]ERROR: Could not SQLConnectbut the data source and driver required are listed by
odbcinst -q -dand
odbcinst -q -sthen try iusql.
"The unixODBC Administrator Manual (HTML)"
For a full list of contributors, refer to the AUTHORS file.
|Thu 14 Jan 2021||version 2.3.11|