Looking up tables, columns, and procedures in Interactive SQL

While you are entering statements in Interactive SQL, you can look up the names of tables, columns, or procedures stored in the current database and insert them at your cursor position.

 Look up the names of tables in the database
  1. Click Tools » Lookup Table Name or press F7.

  2. Find and select the table.

  3. Click OK to insert the table name into the SQL Statements pane at the current cursor position.

 Look up column names in the database
  1. Click Tools » Lookup Table Name or press F7.

  2. Find and select the table containing the column.

  3. Click Show Columns.

  4. Select the column and click OK to insert the column name into the SQL Statements pane at the current cursor position.

 Look up the names of procedures in the database
  1. Click Tools » Lookup Procedure Name or press F8.

  2. Find and select the procedure.

  3. Click OK to insert the procedure name into the SQL Statements pane at the current cursor position.

In the Lookup Table Name and Lookup Procedure Name windows, you can enter the first few characters of the table or procedure you are looking for. The list is narrowed to include only those items that start with the text you entered.

You can use the SQL wildcard characters '%' (percent sign) and '_' (underscore) to help narrow your search. '%' matches any string of zero or more characters, while '_' matches any one character.

For example, to list all the tables that contain the word profile, type %profile%.

If you want to search for a percent sign or underscore within a table name, you must prefix the percent sign or underscore with an escape character. The escape character for the SQL Anywhere ODBC driver and SQL Anywhere JDBC driver is '~' (tilde).

Tip

Interactive SQL supports text completion for database object names when you type in the SQL Statements pane, which can be used as an alternative to looking up table and procedure names. See Using text completion.