unixODBC - isql

1 - About

An unixODBC client

3 - Syntax


isql DSN [UID [PWD]] [options]

where Options:

  • -b: batch.(no prompting etc)
  • -dx: delimit columns with x
  • -x0xXX delimit columns with XX, where:
    • x is in hex,
    • ie 0x09 is tab
  • -w: wrap results in an HTML table
  • -c: column names on first row (only used when -d)
  • -mn: limit column display width to n
  • -v: verbose
  • -lx: set locale to x
  • -q: wrap char fields in dquotes
  • -3: Use ODBC 3 calls
  • -n: Use new line processing
  • -e: Use SQLExecDirect not Prepare
  • -k: Use SQLDriverConnect. Treat the DSN as a connection string and use SQLDriverConnect isql -k “DSN=server;UID=test;PWD=test”
  • –version version

4 - Commands

  • help - list tables
  • help table - list columns in table
  • help help - list all help options

5 - Examples

5.1 - Basic


isql -v WebDB MyID MyPWD


+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+

5.2 - Execute a query

5.2.1 - With an extern file


isql WebDB MyID MyPWD -w < My.sql

Each line in My.sql must contain exactly 1 SQL command except for the last line which must be blank (unless -n option specified).

5.2.2 - With a sql

Type the SQL in one line and after that the go statement.


select 1 from dummy
go


+------------+
| 1          |
+------------+
| 1          |
+------------+
SQLRowCount returns 1
1 rows fetched

6 - Support

6.1 - Verbose


isql -v WebDB MyID MyPWD


[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

6.2 - ODBCINI and ODBCSYSINI variable


$ echo $ODBCINI


/u01/app/oracle/product/fmw/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/odbc.ini


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap