sql utility
This is a command line utility which can execute SQL statements. Any result sets are emitted as text on standard output. It is intended as a diagnostic tool for the kiodbc server.
The SQL statement is the last argument on the line and should be quoted. You can also put it in a file referenced by the -y switch.
If no KCML_SOURCES environment variable is defined the utility will look for the database sources file in the directory where its binary is executed (usually /usr/local/kcml on Unix systems).
Example:
sql -d BENCH "SELECT * FROM DATA1"
| Switch | Purpose |
|---|---|
| -c dir | Change directory |
| -C TableName | Display column information for the given table |
| -d dbase | Use specified database |
| -f FileName | Take SQL from the file |
| -h | HTML output |
| -I TableName | Column information for given table |
| -k LibraryName | Specifies the location of an application callback library for use with Oracle/PostGreSQL databases |
| -l num | Work in specified lang. The number is that used in $OPTIONS RUN byte 20 |
| -n xsl_url | Use given URL in XML output |
| -o level | Set optimization level |
| -P | Parse only |
| -q | Create a ODBC_RW filename |
| -r | NT register |
| -R | Use Rev8 filenames |
| -s | Use short column names |
| -t level | Set tracing level |
| -T DatabaseType | Set database type |
| -u user | Impersonate specified user |
| -v param | Supply a dynamic parameter |
| -w WorkDir | Specify directory to use as workspace |
| -x TableName | List table data as INSERT statements |
| -y FileName | Take SQL from the file |
| -z | List tables in the database |
| -8 | Use Rev8 filenames |
| -? | Display sql utility usage |