This section describes the commands available when using ODBCISQL.
cmdfile file_name
Reads the commands from the given command file.
connect [userID*password@]database
Connects to the given data source. The database argument is the ODBC DSN entry. The userID and password are required when connecting to a server which requires userID and password. For example, the memory data source requires userID and password. The program supports only one connection at any instance. If the data source is currently connected to a different server, the connection is closed before the new connection is established.
describe "sql_stmt";
Obtains detailed schema information for query results. In the following example, this command returns a summary of column names, data types, and other results.
If the SQL statement is not a query, this command reports that there are no columns to describe.
This command can also be used to get schema details of a table. In this case, along with reporting the column data, the command returns information about the indexes of the table as well as table statistics, such as row count.
disconnect
Disconnects from the data source.
echo information
Echoes the given information.
errfile file_name
Errors are written to the file_name file.
# [comment]
Ignores the text following the pound sign. This is useful when OAISQL is set up to run automated test scripts that can be documented with comment lines. Note that if the -e option is enabled, the comment will be echoed to the standard out.
exec sql_stmt; or !sql_stmt;
Executes the given SQL statement. The SQL statement can be entered on multiple lines and must be terminated by a semicolon.
sql_smt;
Executes only the supported set of SQL statements. This command supports the following DML statements (SELECT, INSERT, UPDATE, DELETE, CALL) and DDL statements (CREATE TABLE, DROP TABLE). The SQL statement can be entered on multiple lines and must be terminated by a semicolon.
show/list tables;
Provides a list of all the available tables and their information as shown in the following example: