ij Commands and Errors Reference
Page 2 of 39

ij Commands

ij accepts several commands to control its use of JDBC. It recognizes a semicolon as the end of an ij or SQL command; it treats semicolons within SQL comments, strings, and delimited identifiers as part of those constructs, not as the end of the command. Semicolons are required at the end of an ij or SQL statement.

All ij commands, identifiers, and keywords are case-insensitive.

Commands can span multiple lines without any special escaping for the ends of lines. This means that if a string spans a line, the newlines will show up in the value in the string.

ij treats any command that it does not recognize as an SQL command to be passed to the underlying connection, so syntactic errors in ij commands will cause them to be handed to the SQL engine and will probably result in SQL parsing errors.

The ij commands are:

Absolute

Commit

Execute

Help

Prepare

Remove

UnicodeEscape


After Last

Connect

Exit

Last

Previous

Rollback

Wait For

Autocommit

Disconnect

First

LocalizedDisplay

Protocol

Run

Before First

Driver

Get Cursor

MaximumDisplayWidth

Readonly

Set Connection

Close

Elapsedtime

Get Scroll Insensitive Cursor

Next

Relative

Show Connections

The ij common elements (used in several commands) are:

Conventions for ij Examples

Examples in this document show input from the keyboard or a file in bold text and console output from the DOS prompt or the ij application in regular text.

C:\> REM This example is from a DOS prompt using JDK1.1.x java:
C:\> java -Dij.protocol=jdbc:cloudscape: COM.cloudscape.tools.ij
ij version 3.6 (c) 1997-2000 Informix Software, Inc.
ij> connect 'menuDB;create=true';
ij> CREATE TABLE menu(course CHAR(10), item CHAR(20), price INTEGER);
0 rows inserted/updated/deleted
ij> disconnect;
ij> exit;
C:\> 

ij SQL Command Behavior

Any command other than those documented in "ij Command Reference" are handed to the current connection to execute directly. The statement's closing semicolon, used by ij to determine that it has ended, is not passed to the underlying connection. Only one statement at a time is passed to the connection. If the underlying connection itself accepts semicolon-separated statements (which Cloudscape does not), they can be passed to the connection using ij's Execute command to pass in a command string containing semicolon-separated commands.

ij uses the result of the JDBC execute request to determine whether it should print a number-of-rows message or display a result set.

If a JDBC execute request causes an exception, it displays the SQLState, if any, and error message.

Setting the ij property ij.showErrorCode to true displays the SQLException's error code (see Chapter 4, "ij Properties Reference").

The number-of-rows message for inserts, updates, and deletes conforms to the JDBC specification for any SQL statement that does not have a result set. DDL (data definition language) commands typically report "0 rows inserted/updated/deleted" when they successfully complete.

To display a result set, ij formats a banner based on the JDBC ResultSetMetaData information returned from getColumnLabel and getColumnWidth. Long columns wrap the screen width, using multiple lines. An & character denotes truncation (ij limits displayed width of a column to 128 characters by default; see MaximumDisplayWidth).

ij displays rows as it fetches them. If the underlying DBMS materializes rows only as they are requested, ij displays a partial result followed by an error message if there is a error in fetching a row partway through the result set.

ij verifies that a connection exists before issuing statements against it and does not execute SQL when no connection has yet been made.

There is no support in ij for the JDBC feature multiple result sets.

Example

ij> INSERT INTO menu VALUES ('appetizer','baby greens',7);
1 row inserted/updated/deleted
ij> SELECT * FROM menu;
COURSE    |ITEM                |PRICE          
-----------------------------------------------
entree    |lamb chop           |14            
dessert   |creme brulee        |6
appetizer |baby greens         |7

3 rows selected
ij>