Running Interactive SQL queries

Interactive SQL is a utility that ships with Sybase IQ that lets you execute SQL statements, build scripts, and display database data.

Starting Interactive SQL opens a dialog that lets you define the connection parameters to your server or database. If you need connection help, click the arrow in the top-right corner to display a Connect Assistant.

StepsStarting Interactive SQL and running queries

Assume that iqdemo is running on a local host named localhost-xp.

  1. Run dbisql from the $IQDIR15/bin <64> or $IQDIR15/bin<32> directory. Interactive SQL starts and displays a connection dialog.

  2. On the Identification tab, type DBA in the User box, and sql in the Password box. DBA is not case-sensitive; sql is case-sensitive, and must appear in all lowercase letters.

  3. On the Database tab, choose a server from the Server name box. If there are no servers listed, click Find to search for running servers.

    Server names appear in this format <hostname>_dbname. If the host name is localhost-xp and you are running the demo iqdemo database, the server name is localhost-xp_iqdemo.

  4. Choose iqdemo as the database. If there is only one database running, you can leave this field blank.

  5. What you do next depends on the server location:

    • If you are running Interactive SQL against a server installed on the same machine, you must also choose an appropriate database file.

    • If you are running Interactive SQL against a networked server, click the Network tab, click the TCP/IP box, then specify the Host name and Port number.

  6. Click OK to open Interactive SQL.

  7. In the SQL Statements window, type:

    SELECT * FROM employees
    
  8. To execute the query, click the right-facing triangle on the toolbar.

NoteNotes