Interactive SQL
Interactive SQL
SAP IQ 16.0 SP 10
Document Version: 1.0 – 2015-07-07
2 Connect to a Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 Connect Using a Connection Favorite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Connect Window Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Connecting Using an ODBC Data Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Connecting to a Running Database on this Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5 Connecting to a Running Database on Another Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
2.6 Connecting to a Logical Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.7 Starting and Connecting to a Database on this Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.8 Starting and Connecting to a Database on Another Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.9 Connecting with a Connection String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Connection Parameters for Interactive SQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.10 Connecting to the Utility Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5 Keyboard Shortcuts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
9 Favorites List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.1 Showing or Hiding the Favorites Pane. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.2 Creating a Connection Favorite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.3 Creating a SQL Statements Favorite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78
Procedure
For:
Windows 7 Select Start All Programs SAP SAP IQ 16.0 Interactive SQL .
Context
Note
Interactive SQL does not accept @filename parameters. Exit codes are 0 (success) or nonzero (failure).
Procedure
For:
Note
If the options specified do not include user ID and password, the Connect window opens, allowing you to
enter the required information.
Example
This command runs the command file mycom.sql against the current default server, using the user ID DBA
and the password sql. If there is an error in the command file, the process terminates.
This command adds user joe to the current default database with the password mypwd:
This command connects to the database on host 10.123.5.789, port 1111. Since the command does not
include logon credentials, the Connect window opens, prompting you to enter the user ID and password.
dbisql -c "host=10.123.5.789:1111"
Related Information
Table 2:
Option Description
-c< "keyword=value; ..."> Specifies connection parameters. If you do not specify this option, the environment
variable SQLCONNECT is used.
Note
Always specify connection parameters for Interactive SQL instead of relying on
defaults to prevent unintended connections. If you start more than one database
on a server, for example, specify the database name, and in a network with sub
nets, specify the communications protocol parameter with host number.
-d <delimiter> Specifies a command delimiter. Quotation marks around the delimiter are optional,
except when the command shell itself interprets the delimiter in some special way.
Command delimiters are used for all connections in the current Interactive SQL ses
sion, regardless of the setting stored in the database (for either the user or the PUB
LIC setting).
-d1 Echoes all statements that Interactive SQL executes to the Command window
(stdout). This feedback might be useful when you are debugging SQL scripts, or
when Interactive SQL is processing a long SQL script.
Note
The final character of the option is the number 1, not a lowercase L.
-datasource <dsn-name> Specifies an ODBC data source to connect to. You need not be using the SAP SQL
Anywhere 16 JDBC driver to use this option. However, if the data source to which you
are connecting is not configured to use TCP/IP, you must use the SAP SQL Any
where 16 JDBC driver to connect. By default, SAP IQ data sources are configured to
use TCP/IP.
-f <file name> Opens (but does not run) the file called <file name>. You must enclose the file
name in quotes if the file name contains any space characters; otherwise, quotation
marks are optional. If the file does not exist, or if it is a directory instead of a file, In
teractive SQL prints an error message to the console and quits. If the file name does
not include a full drive and path specification, the file is assumed to be relative to the
current directory.
-host <host name> Specifies the host name or IP address of the computer on which the database server
is running. You can use the name localhost to represent the current machine.
-nogui Runs Interactive SQL in a command-prompt mode, without a graphical user inter
face. This is useful for batch operations. If you specify either <dbisql-command> or
<command-file>, then -nogui is assumed.
In -nogui mode, Interactive SQL sets the program exit code to indicate success or
failure. On Windows operating systems, the environment variable ERRORLEVEL is
set to the program exit code. Exit codes are:
0 success.
1 general failure. At some point, a SQL or Interactive SQL statement did not exe
cute successfully and the you chose to stop executing SQL statements. Alterna
tively, Interactive SQL noted an internal error.
5 user terminated Interactive SQL. When an error occurs during execution, you
are prompted to ignore the error, stop, or exit Interactive SQL. If you opt to exit,
the program returns code 5. The program also returns code 5 if an error occurs
and the Interactive SQL option ON_ERROR is set to EXIT.
9 unable to connect.
255 bad command. The command line contained incomplete or invalid switches.
Note
In -nogui mode, any SQL text you enter at the command prompt is executed
when you press Enter, even if you specify a command delimiter using the -d
switch. Ensure the SQL command is complete before you press Enter.
-onerror [CONTINUE | EXIT] Controls what happens if an error is encountered while reading statements from a
command file. This option overrides the ON_ERROR setting. This option is useful
when using Interactive SQL in batch operations.
-port <portnumber> Specifies the port number on which the database server is running. The default port
number for SAP IQ is 2638.
-q Runs in quiet mode, that is, does not display output messages. This option is useful
only if you start Interactive SQL with a command or command file. Specifying this op
tion does not suppress error messages.
Note
If the data extraction commands (primarily setting the option TEMP_EX
TRACT_NAME1 to an output file) are contained in a command file, you must ena
ble the Show all result sets option before using the -q option. See Set
ting Quiet Mode Prerequisites.
-x Scans commands but does not execute them. You may find this option useful for
checking long command files for syntax errors.
Related Information
The Connect window supports several methods of connecting to a database. The settings in this window are
preserved for the current Interactive SQL session only.
You can use a connection favorite to connect to a database. The favorite stores connection details, including
password.
Procedure
1. If the Connect window appears while you are starting Interactive SQL, click Cancel.
2. In the Favorites list, click the connection link.
Note
○ If the Favorite list is hidden, click Favorites Show Favorites .
○ If Interactive SQL cannot establish a connection, you see an error message.
○ If the favorite is missing connection information, you see the Connect window.
Related Information
You can manage and test your connection with the Tools button in the Connect window.
Table 3:
Tool Description
Copy Connection String to Clipboard Creates a connection string from the options you have
specified, and copies the string onto your clipboard.
Save As ODBC Data Source Saves the new data source to your list of ODBC user data
sources.
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action list, select Connect with an ODBC Data Source.
3. Do one of:
○ Select ODBC Data Source name and the name to connect to the database. In Windows, you can click
Browse to view a list of available data sources.
○ Select ODBC Data Source name and click Open The ODBC Data Source Administrator. Select an
ODBC data source from the list of available data sources, create a new data source, or configure an
existing data source.
○ Select ODBC Data Source file and the ODBC data source file name for the connection. File data
sources hold the same information as ODBC data sources that are stored in the registry.
Tip
Information that you enter in the Connect window, such as the user ID or password, is used instead of
any parameters that are stored in an ODBC data source or an ODBC data source file.
4. Click Connect.
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action list, select Connect to a running database on this computer.
3. In the Server name field, enter the name of the server that you are connecting to, or choose a recently
used server name from the list.
4. In the Database name field, enter the name of the database that you are connectiong to, or choose a
recently used database name from the list.
5. Click Connect.
Related Information
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action list, select Connect to a running database on another computer.
3. In the Host field, specify the name of the computer where the database is running, or click Recent and
choose a recently used host and port combination.
4. (Optional) Click Ping to verify that a computer with the given host name exists on your network.
5. In the Port field, specify the port your database is using.
6. In the Server name field, enter the name of the server that you are connecting to, or choose a recently
used server name from the list.
7. (Optional) Click Find to see a list of running local and network servers.
8. In the Database name field, enter the name of the database that you are connectiong to, or choose a
recently used database name from the list.
9. Click Connect.
Related Information
Context
The connection fails if the current node is not a member of any logical server that is assigned to the user's
login policy, or if the current login policy assigns:
● SERVER as the logical server, and the user lacks sufficient system privilege.
● NONE as the as logical server.
● COORDINATOR as the logical server, and the user connects to a secondary server without enabling login
redirection.
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action List, select Connect to a logical server.
3. In the Logical server field, select the node type of the logical server.
4. In the Host field, specify the computer name where the logical server is running or click Recent to choose
a recently-used host and port combination.
5. (Optional) Click Ping to verify that a computer with the given host name exists on your network.
6. In the Port field, specify the port number of one of the nodes associated with the logical server.
7. Click Connect.
Related Information
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action list, select Start and connect to a database on this computer.
3. In the Database file field, enter the full path and name of the database file, (for example, C:\demo
\sample.db), choose a recently used database file from the list, or click Browse to search for the
database file. If you do not specify a full path, the path used is relative to the working directory of the
database server.
4. In the Encryption key field, if the database file is encrypted, you must supply a key to the database server
every time the database starts.
5. In the Database name field, enter the name of the database that you are starting and connectiong to, or
choose a recently used database name from the list.
6. In the Server name field, enter the name of the server that you are starting and connecting to, or choose a
recently used server name from the list. .
7. (Optional) In the Start line field, enter a command to start the database server on your computer or
choose a recently used start line from the dropdown list.
Related Information
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Action list, select Start and connect to a database on another computer.
3. In the Database file field, enter the full path and name of the database file, (for example, C:\demo
\sample.db), choose a recently used database file from the list, or click Browse to search for the
database file. If you do not specify a full path, the path used is relative to the working directory of the
database server.
4. In the Encryption key field, if the database file is encrypted, you must supply a key to the database server
every time the database starts.
5. In the Database name field, enter the name of the database that you are starting and connectiong to, or
choose a recently used database name from the list. A database name is optional if you specify a server
name and there is only one database running on the server. Each database running on a server is identified
by a unique database name.
6. In the Server name field, enter the name of the server that you are starting and connecting to, or choose a
recently used server name from the list.
7. (Optional) Click Find to see a list of running local and network servers.
8. In the Host field, specify the name of the computer where the database is running, or click Recent and
choose a recently used host and port combination.
9. (Optional) Click Ping to verify that a computer with the given host name exists on your network.
10. In the Port field, specify the port your database is using.
11. (Optional) Select Stop database after last disconnect to automatically shut down the database after the
last user disconnects.
12. Click Connect.
Procedure
○ Database, and then enter a user ID and case-sensitive password for the connection.
○ Windows Integrated Login. Your Windows user ID and password are supplied to the SAP IQ
integrated login mechanism.
2. In the Acton dropdown list, select Connect with a connection string.
3. In the Parameters field, enter the required connection parameters. You can use connection parameters
with an ODBC data source or ODBC data source file. Enter the connection parameters in a semicolon
delimited list of parameter=value pairs.
parameter1=value1;parameter2=value2;...
For example:
Tip
Any information you enter in the Parameters field, such as the user ID or database name, takes
precedence over the parameters stored in an ODBC data source or an ODBC data source file.
4. Click Connect.
When no database is connected, you must enter connection parameters, either in the Connect window, or on
the command line, using the -c option. Information you enter in the Connect window is not preserved between
sessions.
To connect to a single database, enter the user ID and password only if the server was started on the local
machine with IQTMP16 environment variable set. If there are multiple databases running on the database
server, you must specify additional connection parameters, such as the server or database name.
Controls whether a database stops when there are no more open non-HTTP connections.
Syntax
Default
YES
Description
By default, any database server that is started from a connection string stops when there are no non-HTTP
connections to it. Also, any database that is loaded from a connection string is unloaded when there are no
more non-HTTP connections to it. This behavior is equivalent to AutoStop=YES.
If a connection uses AutoStop=NO, any database started remains running when there are no more non-HTTP
connections to it. As a result, the database server remains operational as well.
If AutoStop=NO and the only connection to the database is an HTTP connection, the database does not stop
automatically when the HTTP connection disconnects. If AutoStop=NO and a database has an HTTP
connection, and a command sequence or TDS connection, when the last command sequence or TDS
connection disconnects, the database stops, and any HTTP connections are dropped.
The AutoStop (ASTOP) connection parameter is used only if you are connecting to a database that is not
currently running. It is ignored if the database is already started.
If .NET applications use the AutoStop connection parameter with caution. Closing a connection closes it as far
as the application is concerned, but active connections remain open when connection pooling is enabled. As a
result the server does not shut down, even though you may expect it to do so.
Syntax
{ CommLinks | LINKS }={ [ SharedMemory | SHMEM ] | ALL | [ TCPIP | TCP ] } [, ... ] <string>
Allowed Values
SharedMemory (SHMEM) (default) connect using the shared memory protocol for same-computer
communication. The client tries shared memory first if it is included in a list of protocols specified by the
CommLinks(LINKS) connection parameter, regardless of the order in which protocols appear.
ALL connect using the shared memory protocol first, followed by TCP/IP.
TCPIP (TCP) connect using the TCP/IP communication protocol. TCP/IP is supported on all operating
systems. You can specify additional network protocol options for TCPIP.
Usage
Default
SharedMemory (SHMEM)
Description
Note
SAP recommends that you only use the CommLinks (LINKS) connection parameter if you need to specify
TCP/IP protocol options other than HOST or ServerPort (PORT). Otherwise, use the Host connection
parameter.
When you use the CommLinks (LINKS) connection parameter for a TCP/IP connection, a server name
should be specified using the ServerName (Server) connection parameter.
If you specify both TCPIP and SharedMemory or CommLinks=ALL, then shared memory is attempted first,
followed by TCP/IP if the database server cannot be found over shared memory. For example, in the following
connection string, shared memory is attempted first:
"UID=DBA;PWD=sql;Server=demo;DBN=demo;LINKS=TCPIP,SHMEM"
The TCP/IP communication protocol is enabled on the database server using the -x option.
Example
The following connection string fragment attempts to connect to the database server named iqdemo running
on the current subnet:
CommLinks=tcpip;Server=iqdemo;UID=DBA;PWD=sql;
The following connection string fragment attempts to connect to the database server named iqdemo. It first
attempts to connect over shared memory. If the database server cannot be located using shared memory, it
attempts to connect using TCP/IP.
CommLinks=tcpip,shmem;Server=iqdemo;UID=DBA;PWD=sql
The following connection string attempts to connect to the server named iqdemo running on the host named
kangaroo.
CommLinks=tcpip(HOST=kangaroo);Server=iqdemo;UID=DBA;PWD=sql
Alternatively, you could use the Host connection parameter to connect to the server named iqdemo running
on the host named kangaroo.
Host=kangaroo;Server=iqdemo;UID=DBA;PWD=sql
Related Information
Indicates which database file you want to load and connect to when starting a database that is not running.
Syntax
Allowed Values
If the file name does not include an extension, SAP IQ looks for a file with the .db extension.
The path of the file is relative to the working directory of the database server. If you start the database
server at a command prompt, the working directory is one form which you run the command. If you start
the database server from an icon or shortcut, the working directory is specified by the icon or shortcut. As
a best practice, you should supply a complete path and file name.
Default
None
Description
If you are unsure whether a database is running, you can use the DatabaseFile (DBF) connection parameter to
start the database and connect to it.
If you specify both the DatabaseFile and DatabaseName (DBN) connection parameters, an attempt is made to
connect to a running database with the specified database name (DatabaseFile is ignored). If that fails, an
attempt is made to start the database automatically using the path indicated by DatabaseFile and assign it the
name specified by DatabaseName.
If you specify DatabaseFile, but not DatabaseName, an attempt is made to connect to a running database with
the same name as the file specified (the path and extension are removed). If that attempt fails, an attempt is
made to start the database automatically using the path indicated by DatabaseFile.
A database cannot be automatically started on a network server unless this behavior is explicitly permitted by
the -gd database server option.
For deployed applications, SAP recommends that you specify a database server name using the ServerName
(Server) parameter when attempting to start a database file automatically if it is not running. Otherwise, the
Caution
The database file must be on the same computer as the database server. Starting a database file that is
located on a network drive can lead to file corruption.
Example
The DatabaseFile (DBF) connection parameter in the following example loads and connects to the sample
database, demo.db:
"DBF=%IQDIR16%\demo.db"
The following two examples assume that you have started a database file named cities.db, and renamed the
database Kitchener as follows:
To successfully start and connect to a database and name it Kitchener specify the following DBN and DBF
connection parameter values:
DBN=Kitchener;DBF=cities.db
Related Information
Syntax
key the encryption key is a string, including mixed cases, numbers, letters, and special characters.
Database keys cannot include leading spaces, trailing spaces, or semicolons.
Default
None
Description
You must specify this parameter when you start an encrypted database with a connection request.
To secure communication packets between client applications and the database server, use the -ec server
option and Transport-Layer Security (TLS).
Example
This connection parameter fragment specifies an encryption key to start the iqdemo database.
"UID=DBA;PWD=sql;Server=myeng;DBKEY=V3moj3952B;DBF=%ALLUSERSPROFILE%\SYBASEIQ
\demo\iqdemo.db"
Syntax
Allowed Values
database-name specifies the name of a database that is already running on a database server, or names a
database that is starting.
None
Description
Whenever a database starts, it is assigned a name, either by the administrator by using the -n option, or by the
database server by using the base of the file name with the extension and path removed.
Connect to a Running Database if the database is already running, use the DatabaseName (DBN)
connection parameter. A connection occurs only if the name of the running database matches
<database-name>. To connect to the utility database, use the database name utility_db. To prevent
an attempt to start the database if it is not already running, use DatabaseName rather than DatabaseFile.
Start a Database That Is Not Running if you specify both DatabaseName and DatabaseFile, an attempt is
made to connect to a running database with the specified database name (DatabaseFile is ignored), and if
that fails, an attempt is made to start the database automatically using the path indicated by the
DatabaseFile and assign it the name specified by DatabaseName. DatabaseName is recommended for
naming databases, rather than using the DatabaseSwitches (DBS) connection parameter with the -n
option or the START connection parameter with the -n option.
Example
To start a database named cities.db and name the database Kitchener, use the following connection string:
"DBF=cities.db;DBN=Kitchener;UID=DBA;PWD=sql"
To connect to a running database named Kitchener, use the following connection string:
"DBN=Kitchener;UID=DBA;PWD=sql"
Related Information
Tells the ODBC driver manager or embedded SQL library where to look in the registry or the system
information file (named .odbc.ini by default) to find ODBC data source information.
Syntax
Allowed Values
data-source-name specifies the name of the ODBC data source that contains connection information for
your database.
Default
None
Description
Usually, ODBC applications send only a data source name to ODBC. The ODBC driver manager and ODBC
driver locate the data source, which contains the remainder of the connection parameters.
Example
DSN=My Database
Syntax
Allowed Values
password-string an encrypted password for the database you are connecting to.
Default
None
Description
Every user of a database has a password. The password must be supplied for the user to connect to the
database.
Caution
When creating a data source, do not include the password as part of the definition as including this
information poses a security risk.
You can encrypt a password that is stored in an ODBC data source by using the -pe option with the Data
Source utility (iqdsn).
On UNIX, data source information is stored in a system information file (which is, by default,
named .odbc.ini).
Tells the client library there is an ODBC file data source holding information about the database to which you
want to connect.
Syntax
Allowed Values
file-data-source-name specifies the name of the file data source that contains connection information for
your database.
Default
None
Description
File data sources hold the same information as ODBC data sources stored in the registry. You can easily
distribute file data sources to end users, preventing connection information from having to be reconstructed
on each computer. `Both ODBC and Embedded SQL applications can use file data sources.
Accepts a host name or IP address and optional port number that tells the client where to find the database
server.
Syntax
Allowed Values
hostname the name of the computer where the database server is running. The list of host values is a
comma-separated list, which can optionally include a port number (separated by a colon). You can use
localhost to identify the current computer.
ip-address must be specified in the standard form of an IP address and can optionally include a port
number (separated by a colon). The list of IP addresses is a comma-separated list. For IPv6 addresses
that include a port number, you must enclose the address in either square brackets or parentheses. For
example, Host=[fd77:ab34:2238::3894]:8933, where 8933 is the port number.
port-number used by the database server. The default port number is 2638.
Default
None
Description
The Host connection parameter specifies one or more host names (or IP addresses) and optional port
numbers that tell the client where a database server is running.
The Host connection parameter identifies one or more computer systems running database servers.
If a computer system is running more than one database server and you do not specify a port, use the
ServerName connection parameter to identify which database server to connect to. SAP recommends that
you always use the ServerName parameter, particularly for embedded applications.
When multiple addresses are specified, the addresses are attempted in the following order:
1. The specified addresses are checked against the database server address cache (sasrv.ini). If a match
is found, then this address in the database server cache is attempted first.
2. The addresses are attempted in the order in which they are specified.
When you use the Host parameter, no UDP packets are sent if enough information is given to uniquely identify
the server (a host name and a port number). If neither a port number nor database server name is given, the
port number is assumed to be 2638 and the client does not perform a broadcast. However, if the client has a
host name and database server name but no port number, it sends a UDP packet to port 2638 on the specified
host to find the port number.
You cannot specify the LocalOnly protocol option with the HOST protocol option or the Host connection
parameter.
Note
The Host connection parameter disables shared memory. To use the Host connection parameter to
connect to a personal database server, use the -x option to enable the TCP/IP communication protocol on
the database server. Also, you must use the host name localhost when connecting to a personal database
server using TCP/IP.
SAP recommends that you only use the CommLinks (LINKS) connection parameter if you need to specify
TCP/IP protocol options other than HOST or ServerPort (PORT).
Related Information
Syntax
Allowed Values
password-string passwords have a maximum length of 255 bytes and are case-sensitive. Passwords
cannot include leading spaces, trailing spaces, or semicolons.
Default
None
Description
Every user of a database has a password. The password must be supplied for the user to be allowed to connect
to the database.
The Password (PWD) connection parameter is not encrypted. An application can include the password in the
connection string. If both the Password and the EncryptedPassword (ENP) connection parameters are
specified, Password takes precedence.
Caution
When creating a data source, do not include the password as part of the definition as including this
information poses a security risk.
On UNIX, data source information is stored in a system information file (which is, by default,
named .odbc.ini).
Related Information
Specifies the name of a running database server to which you want to connect.
Syntax
Allowed Values
database-server-name-string
The server name is interpreted according to the character set of the client computer. Do not use non-
ASCII characters in server names.
Long database server names are truncated to different lengths depending on the protocol.
Default
Description
EngineName and ENG are still accepted, but these variations have been deprecated.
When a database server starts, it attempts to become the default database server on the computer on which it
is installed. The first database server to start when there is no default server becomes the default database
server. Shared memory connection attempts on that computer that do not explicitly specify a database server
name connect to the default server.
In the Connect window, the ServerName connection parameter is the Server Name field.
Note
Include the ServerName parameter in connection strings for deployed applications. Doing so ensures that
the application connects to the correct server when a computer is running multiple SAP IQ database
servers, and can help prevent timing-dependent connection failures.
Use the -xd option for database servers being used by deployed applications, and also make user that all
clients use the ServerName parameter to explicitly specify the name of the database server to which they
must connect. Doing so ensures that the application connects to the correct database server when a host is
running multiple SQL Anywhere database servers.
Example
Server=Guelph
Related Information
Syntax
Allowed Values
Usage
Default
None
Description
The StartLine connection parameter starts a database server only if a connection cannot be made to the
specified database server.
For example, suppose you start a database server running a database as follows:
iqsrv16 c:\mydb.db
Connect another database (without using the ServerName connection parameter to specify a database server
name):
In this case, the database server is not started. Instead, the database server, which started mydb.db, starts
and connects to myseconddb.db.
However, if you had specified Server=myserver, and a database server named myserver was not running, the
database server myserver would have started.
Note
To specify the database name, database file, or server name, use the DatabaseName (DBN), DatabaseFile
(DBF), and ServerName(Server) connection parameters, rather than specifying the database server
options in the StartLine connection parameter.
START=iqsrv16 -c 8M;Server=myserver;DBF=c:\sample.db;DBN=mydb
Syntax
Allowed Values
Default
None
Description
You must always supply a user ID when connecting to a database, unless you are using an integrated or
Kerberos login.
This connection string fragment supplies the user ID DBA and the password sql:
UID=DBA;PWD=sql
Connecting to the utility database allows you to execute database file administration statements, query
connection and server properties, and connect to a running database server when user databases are
nonexistent or unavailable.
Prerequisites
The -su database server option specifies the password for the utility database. To connect to a utility
database on a server that was started using the -su option, you need the password that was set by the -su
option.
On a network server, if the -su database server option was not specified, then you cannot connect to the utility
database.
Context
The utility database is a phantom database with no database files or data. When you are connected to the
utility database, executing REVOKE CONNECT FROM DBA disables future connections to the utility database.
No future connections can be made to the utility database unless you use a connection that existed before the
REVOKE CONNECT was done, or restart the database server.
Procedure
SQL Statements pane enter SQL statements in this pane to query and modify your database.
Results pane displays either the results of executed SQL statements, or messages from the database
server about their execution. Click the applicable tab at the bottom of the pane to toggle the display. You
can edit the output in the Results tab, which updates the database.
Favorites pane
(optional) allows you to store frequently used SQL command files in a favorites list that are specific to your
user login. Your favorites list cannot be seen by other users.
Related Information
These keyboard shortcuts are available regardless of which pane has the focus:
Table 5:
Shortcut Key Description
In the Results pane, if the results are not the entire result set, you are prompted to fetch the
remaining rows. Otherwise the currently fetched results are selected.
Ctrl+C Copies the selected text in the active pane to the clipboard.
Ctrl+N Clears the contents of the SQL Statements and Results panes.
Home Moves the cursor to the start of the current line or to the first word on the current line.
These keyboard shortcuts are available when the SQL Statements pane has the focus:
Table 6:
Shortcut Key Description
Ctrl+G Opens the Go To dialog, in which you can specify the number of the line you want to move to.
Ctrl+L Deletes the current line and places it onto the clipboard.
Enter Accepts the selection and closes the text completion window.
F3 Finds the next occurrence of the selected text when the Find/Replace window is closed.
F9 Executes the text that is selected in the SQL Statements pane. If no text is selected, all of the
statements are executed.
Shift+F3 Finds the previous occurrence of the selected text when the Find/Replace window is closed.
Shift+Home Extends the selection to the start of the text on the current line.
Tab Accepts the selection and closes the text completion window.
These keyboard shortcuts are available when the Results pane has the focus:
Table 7:
Shortcut Key Description
Context
Select Tools > Options. Choose Editor and then click the Tabs tab. Type a new number in the Indent Size field.
Procedure
You can configure the Esc key to clear the SQL Statements pane and close any open results sets.
Context
By default, the Esc key leaves the contents of the SQL Statements pane unchanged.
Procedure
Procedure
Note
You can also access the Query Editor configuration page by clicking Options in the Query Editor.
Table 8:
Setting Description
Fully qualify table and col Use fully qualified table and column names when constructing SELECT statements.
umn names
Quote names Enclose the names of identifiers in double quotation marks when constructing SELECT
statements.
Get list of tables on startup (Default) Automatically populate the list of tables when the Query Editor opens.
Caution
If you are connected to a database with a large number of tables or have a slow
communications link, you may want to disable this option to speed up the opening
of the Query Editor.
3. Click OK.
You can configure the Execute Statements button on the toolbar to execute only selected SQL statements or
all statements.
Context
By default, the Execute Statements toolbar button executes all SQL statement that appear in the SQL
Statements pane.
Procedure
Procedure
You must enable the Show all result sets option if you are using Interactive SQL with the -q option (quiet
mode), and if data extraction commands (primarily setting the option TEMP_EXTRACT_NAME1 to an output file)
are contained in a command file.
Context
Caution
The data extraction output file is not created if this option is not set.
Procedure
You can disable some warning messages that appear in Interactive SQL. For example, you can suppress the
warning that appears when you exit Intearactive SQL with unsaved text in the SQL Statements pane.
Procedure
You can disable the ability to edit values in the Results tab.
Procedure
Note
You must execute a new query for the setting to take effect.
You can make Interactive SQL the default editor for saved SQL statements (.sql) and query plan (.saplan)
files.
Procedure
You can configure the Text Completion feature to automatically open, automatically complete, or
automatically add closing brackets and quotation marks as you type in the SQL Statement pane or in the SQL
pane in the Plan Viewer.
Procedure
○ Open Automatically
○ Complete Automatically
○ Add closing brackets and quotation marks
3. Click OK.
Use the tools in Interactive SQL to help you build and execute queries.
The text completion feature supplies you with complete keywords and object names as you type.
For example, typing the letters IQ opens a text completion window that includes a list of possible keywords or
object names beginning with the letters SA. The more characters you type, the more narrow the list.
Text completion is available in the SQL Statements pane or Query Plan viewer and is, by default, enabled. You
can configure text completion behavior from the Tools Options window. Highlight the object name and
press Enter to insert it in the SQL pane.
When enabled, the text completion window opens only if the key sequence typed is not recognized as the
beginning of a valid keyword or object name.
Keyboard shortcuts that are available when the text completion list is open.
Table 9:
Key Description
Ctrl+Double quote (") (or Ctrl+Shift+') Completes the name, and enclose it in quotation marks, re
gardless of the setting of the quoted_indentifier op
tion.
Ctrl+Asterisk (*) (or Ctrl+Shift+8) For tables, inserts a comma-separated list of columns, in
cluding data types. For stored procedures, inserts the pro
cedure name, followed by a comma-separated list of param
eter names and their data types.
Ctrl+Plus Sign (+) (or Ctrl+Shift+=) For tables, inserts a comma-separated list of columns. For
stored procedures, inserts the procedure name, followed by
a comma-separated list of parameter names.
Esc Closes the text completion window without adding any text.
Tab Accepts the selection and closes the text completion win
dow.
You can convert existing lines of text, SQL statements, or statement blocks to comments, which are not
executed.
Context
Note
You can add comments in statements in both the SQL Statements pane and the Query Plan Viewer.
However, the steps described here are supported only in the SQL Statements pane. In the Query Plan
Viewer, you must manually type the comment syntax at the beginning of each line.
● -- (double hyphen)
● // (double slash)
● /* ... */ (slash-asterisk)
Procedure
1. To:
Table 10:
Task Action
Comment a single line of text. Position the cursor anywhere on the line to be com
mented; you need not select any text.
Comment multiple lines of text. Select at least one character on each sequential line of
text to be commented.
Table 11:
Comment Type Action
You can convert commented text to text, SQL statements, or statement blocks.
Context
Note
You can remove comments from statements in both the SQL Statements pane and the Query Plan Viewer.
However, the steps described here are supported only in the SQL Statements pane. In the Query Plan
Viewer, you must manually remove the comment syntax from the beginning of each line being commented.
1. To:
Table 12:
Task Action
Uncomment a single line text. Position the cursor somewhere on the line to be uncom
mented; it is not necessary to select the text.
Uncomment multiple lines of text. Select at least one character on each sequential line of
text to be uncommented.
Table 13:
Comment Type Action
Increase or decrease indentation of SQL statements, or change the default number of spaces indented.
Add indentation to a SQL statement or increase the indentation of an already-indented SQL statement.
Context
Procedure
1. Select the text in the SQL Statements pane that you want to indent. If no text is selected, the indentation is
applied to the current line.
2. Press Ctrl+Shift+period to indent one level.
Remove indentation from a SQL statement or decrease the indentation of an already-indented SQL statement.
Procedure
1. Select the text in the SQL Statements pane that you want to decrease the indentation. If no text is
selected, the indentation is applied to the current line.
2. Press Ctrl+Shift+comma to reduce the indent on level.
Related Information
Keyboard shortcuts available when editing text in the SQL Statement pane.
Table 14:
Key Task
Ctrl+A Select all text in pane (also available in the SQL pane of the Plan viewer)
Ctrl+Y Redo
Ctrl+Z Undo
While you are building SQL statements in queries, you can look up the names of tables, views, columns, or
procedures stored in the current database and insert them at your cursor position.
As you build a SQL statement, you can look up the names of tables stored in the database and insert them at
your cursor position.
Context
Note
The lookup feature is not available in the Query Plan Viewer.
Note
You can only insert one table name at a time.
6. Click OK to insert the table name into the SQL Statements pane at the current cursor position.
As you build a SQL statement, you can look up the names of columns on a table and insert it at your cursor
position.
Context
Note
The lookup feature is not available in the Query Plan Viewer.
Procedure
Note
You can only insert one column name at a time.
As you build a SQL statement, you can look up the names of views in the database and insert them at your
cursor position.
Context
Note
The lookup feature is not available in the Query Plan Viewer.
Procedure
Note
You can only insert one view name at a time.
6. Click OK to insert the view name into the SQL Statements pane at the current cursor position.
As you build a SQL statement, you can look up the names of columns on a view and insert it at your cursor
position.
Context
Note
The lookup feature is not available in the Query Plan Viewer.
Procedure
Note
You can only insert one column name at a time.
7. Click OK to insert the column name into the SQL Statements pane at the current cursor position.
As you build a SQL statement, you can look up the names of procedures stored in the database and insert the
name at your cursor position. You can include system procedures and user-defined procedures in the list.
Context
Note
The lookup feature is not available in the Query Plan Viewer.
Note
You can only insert one procedure name at a time.
7. Click OK to insert the procedure name into the SQL Statements pane at the current cursor position.
You can quickly clear the SQL Statements pane when you finish working with the SQL code.
Procedure
Position the cursor in the SQL Statements pane and do one of:
Results
Note
Pressing Esc also clears the Results pane; pressing Delete does not.
Related Information
You can execute all or select queries in the SQL Statements pane.
If there are multiple queries in the SQL statements pane, you can execute all statements at once.
Context
A query can contain multiple SQL statements. The semicolon identifies the end of a query. If you execute a
single query, and it returns multiple results sets, each set appears in its own numbered Results tab, while all
messages appear in a single Messages tab. However, if you execute multiple queries, the results set of each
successive query replaces the previous results set; only the last results sets of the last query executed
appears.
The following query contains two SELECT statements. It executes as a single query because no semicolon
separates the two statements. It generates two results sets, one for each SELECT statement.
This query contains the same two SELECT statements, but includes a semicolon at the end of the first SELECT
statement, which means it executes as two separate queries. When execution completes, only the results set
for the second query are shown.
Procedure
With your queries entered in the SQL Statements pane, do one of:
○ Press F5.
○ Select SQL Execute .
○ (If configured) Click the Execute all statement(s) icon on the Interactive SQL toolbar.
You can execute one or more selected queries in the SQL Statements pane.
Context
A query can contain multiple SQL statements. The semicolon identifies the end of a query. If you execute a
single query, and it returns multiple results sets, each set appears in its own numbered Results tab, while all
messages appear in a single Messages tab. However, if you execute multiple queries, the results set of each
successive query replaces the previous results set; only the last results sets of the last query executed
appears.
The following query contains two SELECT statements. It executes as a single query because no semicolon
separates the two statements. It generates two results sets, one for each SELECT statement.
This query contains the same two SELECT statements, but includes a semicolon at the end of the first SELECT
statement, which means it executes as two separate queries. When execution completes, only the results set
for the second query are shown.
If no query is selected, all queries in the SQL Statements pane are executed.
Procedure
1. Type your queries in the SQL Statements pane and select the queries to run.
Note
The queries must be selectable as a single block.
2. Do one of:
Results
If the selected queries return multiple results sets, each set appears in its own numbered Results tab, while all
messages appear in the same Messages tab.
Related Information
If there are multiple queries in the SQL Statements pane, you can step through their execution in sequence.
This is useful when debugging.
Context
A query can contain multiple SQL statements. The semicolon identifies the end of a query. If you execute a
single query, and it returns multiple results sets, each set appears in its own numbered Results tab, while all
messages appear in a single Messages tab. However, if you execute multiple queries, the results set of each
successive query replaces the previous results set; only the last results sets of the last query executed
appears.
The following query contains two SELECT statements. It executes as a single query because no semicolon
separates the two statements. It generates two results sets, one for each SELECT statement.
This query contains the same two SELECT statements, but includes a semicolon at the end of the first SELECT
statement, which means it executes as two separate queries. When execution completes, only the results set
for the second query are shown.
Procedure
1. Type your queries in the SQL Statements pane. Ensure each query ends with a semicolon.
2. Place your cursor somewhere in the first query that you want to execute; it does not need to be at the
beginning of the query.
When you execute a command, Interactive SQL automatically saves it in a history list that persists between
sessions. You can also log your executed commands to a log file.
Interactive SQL maintains a record of up to 50 of the most recent commands. You can view the entire list of
commands in the Command History window. The most recent commands appear at the bottom of the list.
You can scroll forward and backward though previously executed commands.
Context
If a previous execution included multiple statements in a single execute command, all associated statements
appear together in the SQL Statements pane.
Procedure
You can view the entire list of commands executed in the History window. The most recent commands appear
at the bottom of the list.
Procedure
Do one of:
○ Press Ctrl+H.
○ Click the Open a list of past SQL statements icon on the toolbar.
You can insert commands in the History window into the SQL Statements pane.
Context
The contents of the SQL Statements pane is cleared before the command is inserted.
Procedure
You can copy selected executed commands from the History window to the Windows clipboard for use in
other applications.
Procedure
Caution
Do not click OK to close the window or the current contents of the SQL Statements pane is cleared and
the selected commands inserted.
Procedure
Context
Caution
You cannot undo this action.
Procedure
Table 15:
Task Action
Remove select commands. 1. Select one or more commands. Use Shift+click or Control+click to select
multiple commands.
2. Press the Delete key or click the Delete button.
You can record commands as you execute them, and store them in a log file.
Context
The logging option applies to the Interactive SQL session, not the database connection. Once enabled, logging
remains active until you disable it, or until you exit Interactive SQL.
The log file records commands executed, execution time, and any messages associated with the execution.
The log file does not record the database name the command was executed against or the user ID executing
the command.
Note
Executing a COMMIT or ROLLBACK using the SQL menu or a keyboard shortcut does not impact the contents
of the SQL Statements pane. However, the Results tab in the Results pane is cleared and the Messages tab
appears.
You can work with the result sets of commands that you execute.
By default, Interactive SQL shows the first result set of the most-recently executed statement, but you can
change this setting to display all result sets.
Procedure
to:
<entry key="SybaseIQ.showMultipleResultSets">1</entry>
c. Save the changes to the file .isqlPreferences16.
2. If using GUI mode:
By default, Interactive SQL shows the first result set of the most-recently executed statement, but you can
change this setting to display all result sets.
Procedure
Once you execute a query in Interactive SQL, you can sort and edit the result set to modify the database. You
can also select rows from the result set and copy them for use in other applications.
Interactive SQL supports editing, inserting, and deleting rows. Editing the result set has the same effect as
executing UPDATE, INSERT, and DELETE statements. After you edit a result set, the equivalent INSERT,
UPDATE, and DELETE statements are added to the Interactive SQL executed commands history.
You must have sufficient privileges on the object to edit a row or value in the result set. For example, to delete
a row, you must have DELETE object-level privilege for the table containing the row.
● The columns in the result set do not include at least all the primary-key columns in the table.
● The result set is the result of a JOIN.
● Table editing is disabled.
When editing fails, you see an error message and database table values remain unchanged.
For character data types only, you can use an Edit window, which lets you move between columns or rows and
save and load data from a file.
You can change any or all of the values in the result provided that you have UPDATE object-level privilege on
the columns being modified, and that table editing is enabled.
Procedure
1. Execute a query.
2. Do one of:
○ Right-click the value you want to change and select Edit Row.
○ Left-click the value you want to change and press F2.
With either method, a blinking cursor and an ... (ellipsis) button appears in the table cell containing the
value.
3. To:
Table 16:
Task Action
Convert value to NULL Click the ... button and select Set to NULL.
Note
The Set to NULL option appears only if the column al
lows NULL values.
Move to the next sequential value in the table. Press Tab or Shift+Tab.
4. To update the database when you finish, press Enter. The cursor moves to the row number at the
beginning of the row.
5. Do one of:
For character data fields only, you can use a text editor to modify values. This makes it easier to see and edit
fields containing large quantities of data.
You can copy the contents of a field to the clipboard or save it to a file.
The Previous Row and Next Row buttons allow you to move between rows in the result set without leaving the
editor. You are prompted to save any changes made to a field before advancing to the next row. The text editor
validates the change and displays an error if the change is invalid.
Similarly, the Previous Column and Next Column buttons allow you to move between columns in the result set
while remaining in the editor.
Note
The Previous Column and Next Column buttons are available only if the next or previous column is a
character data type.
When you add a value in a column that has a default value, the cell editor contains the option Set to DEFAULT.
Similarly, if a column accepts NULL values, Set to NULL appears in the list.
Procedure
To:
○ To override a (NULL) value, position the cursor in the column and enter the new value. There is no need to
remove (NULL) first.
○ To change a column back to (NULL), position the cursor in the column, click the ... (ellipsis) button and
select Set to NULL.
○ To restore the default value in a column, click the ... (ellipsis) button and select Set to DEFAULT.
○ To override a default value, position the cursor in the column and enter the new value. There is no need to
remove (DEFAULT) first.
If the result set contains a computed column and you do not specify a value for the computed column, the
value is calculated when the database is updated. However, if you specify a value for the computed column,
the database is updated with the specified value, and a value is not calculated for the computed column.
You can add a new row to a table that appears in the Results tab. You must have INSERT object-level privilege
on the table to add a new row.
Context
● The columns in the result set do not include at least all the primary-key columns in the table.
● The result set is the result of a JOIN.
● Table editing is disabled.
● You enter an invalid value (for example, you enter a string in a numeric column, or a NULL in a column that
does not allow NULLs) in at least one column in the row.
● The query that generated the result set references a table that contains a column that does not allow
NULL values, and that column is excluded from the result set.
For example, the result set includes three of four columns in TableA. The excluded column does not allow
NULL values. When you insert a row in a result set, every column in the row must be populated, even
excluded columns. By default, excluded columns are automatically populated with NULL values. If at least
one excluded column does not allow NULL values, the row insert fails.
Procedure
For example, you insert a row into a five column table. Each column has a size of 1. You enter the values 1,
22, 3, 44, 5 in each column, respectively. With the cursor resting in column 5, you press Enter. An error
message appears indicating the row could not be updated. The error applies to columns 2 and 4 even
though the cursor is resting in column 5.
You can add rows to a table using the INPUT statement with the PROMPT clause.
Procedure
Note
By default, the Interactive Input window does not display (NULL) or (DEFAULT). Entries are not
validated at time of entry.
3. Do one of:
○ Click Add to add the current row and continue adding rows.
○ Click Done to add the row and close the Interactive Input window.
Deleting rows in the result set deletes the rows from the database table. You must have DELETE object-level
privilege on the table to delete rows.
Context
Note
You cannot delete a column from a result set.
Procedure
Table 17:
Selection Type Action
Individual rows Click the first row to be selected, press and hold the Ctrl key, and click each addi
tional row to be selected.
2. Do one of:
○ Press Delete.
○ Right-click and select Delete Row.
Caution
There is no prompt to confirm the deletion.
3. Do one of:
You can copy rows from the result set and paste them into other applications. Pasted output includes comma-
delimited column names, and character data enclosed in single quotation marks with trailing spaces added to
pad each field to its maximum size.
Procedure
Table 18:
Selection Type Action
Individual rows Click the first row to be selected, press and hold the Ctrl key, and click each addi
tional row to be selected.
2. Do one of:
Table 19:
Copy Type Action
○ Right-click one of the selected rows and select Copy Data Rows .
○ Press Ctrl+C.
Caution
If you select Copy Data Rows only the last selected row of data is copied.
You can copy columns from the result set and then paste them into other applications. All rows within each
selected column are copied.
Context
Pasted output includes comma-delimited column names, and character data enclosed in single quotation
marks with trailing spaces added to pad each field to its maximum size.
Procedure
Table 20:
Selection Type Task
Individual columns Click the first column to be selected, press and hold the Ctrl key, and click each ad
ditional column to be selected.
2. Do one of:
○ Right-click one of the selected columns and select Copy Data Columns .
○ Press Ctrl+C.
Copying individual cells copies only the data to the clipboard. Pasted output includes comma-delimited
columns, but does not include column names or character data enclosed in quotation marks.
Context
Additional cells are automatically selected if the selection crosses both columns and rows with respect to any
of the previously selected cells. The additional selections are required to preserve the row and column layout
1 2 3
4 5 6
7 8 9
You select 1 and 3. Since the selections cross columns but not rows, additional cells are not selected. Pasted
output would be:
1,3
You then select 6. Since this selection crosses both columns and rows from 1 and 3, 4 is automatically
selected. This additional selection is required to preserve the columnar layout. Without the additional
selections, the pasted output would be:
1,3
6
It appears that 1 and 6 reside in the same column in the table. Automatically selecting 4 ensures the pasted
output appears as:
1,3
4,6
Procedure
Table 21:
Selection Type Task
Individual rows Click the first row to be selected, press and hold the Ctrl key, and click each addi
tional row to be selected.
Note
Additional cells may become automatically selected.
2. Do one of:
○ Right-click one of the selected columns and select Copy Data Cells .
○ Press Ctrl+C.
You can sort the results set by a specified column. You cannot subsort on additional columns.
Procedure
You can create INSERT, DELETE, and UPDATE statements for selected rows in the result set.
Procedure
Table 22:
Selection Type Action
Individual rows Click the first row to be selected, press and hold the Ctrl key, and click each addi
tional row to be selected.
2. Right-click one of the selected rows, select Generate, and then select INSERT Statement, DELETE
Statement, or UPDATE Statement. The statement is copied to the clipboard.
You can print the contents of the SQL Statements pane or results set. You can also configure a header and
footer for the printed output.
Procedure
1. Do one of:
○ Press Ctrl+P.
○ Select File Print .
2. Select SQL statements or Results.
3. Click OK.
Related Information
You can store frequently used SQL script files, queries, and database connections in a favorites list. The
favorites list is specific to a single user and cannot be seen by other users.
Context
The option to show or hide the favorites list is a toggle switch. Each press turns the option on or off.
Procedure
You can store frequently used database connections, including password, as a favorite.
Prerequisites
Procedure
1. Do one of:
Note
If you do not select this option, only the User ID is saved.
When you select the favorite to connect, you must specify Action connection information as well as the
password to connect to the database.
4. In the Name field, enter a name for the connection. The favorite name must be unique. You must delete an
existing favorite before you can create a new one with the same name.
5. (Option) Select a folder in the Favorites list in which to store the connection favorite.
6. Click OK.
Context
Note
Each single-query favorite can be a maximum of 16384 characters.
Procedure
1. In the SQL Statements pane, enter the query you want to add to your favorites.
2. Do one of:
Table 23:
Action Task
Save all text in the SQL Statements 1. Select Favorites Add To Favorites or press Ctrl+D.
pane.
2. Select Add SQL statements.
Save select text in the SQL Statements 1. Select the text to be saved as a favorite.
pane.
2. Select Favorites Add To Favorites or press Ctrl+D.
3. Select Add SQL statements.
4. (Only if text is selected in the SQL Statements pane) Select Add only
the currently selected statements.
3. In the Name field, enter a name for the favorite. The favorite name must be unique. You must delete an
existing favorite before you can create a new one with the same name.
4. Click OK.
You can store frequently used SQL command files in a favorites list.
Context
There is no limit on the size of .sql file that you can save as a favorite.
Procedure
Table 24:
Action Task
Save all text in the SQL Statements 1. Select Favorites Add To Favorites or press Ctrl+D.
pane.
2. (Only if a .sql file is open in the SQL Statements pane) Select Add
the open file <file name>.
Save select text in the SQL Statements 1. Select the text to be saved as a favorite.
pane.
2. Select Favorites Add To Favorites or press Ctrl+D.
3. Select Add SQL statements.
4. (Only if text is selected in the SQL Statements pane) Select Add only
the currently selected statements.
4. In the Name field, enter a name for the .sql file. The favorite name must be unique. You must delete an
existing favorite before you can create a new one with the same name.
Procedure
Do one of:
Procedure
1. Do one of:
When using a SQL statement or .sql file favorite, the content of the SQL Statement pane is cleared before the
favorite is loaded. When using a connection favorite, the existing connection is disconnected before the new
connection is established.
Procedure
Do one of:
Procedure
1. Do one of:
Table 25:
Favorite Type Action
Context
The favorites list is specific to a single user and cannot be seen by other users. However, if you export a copy of
user's current favorites list, you can then import it into other user's instances of Interactive SQL.
Procedure
Context
If, when you import favorites, there are duplicates, you can:
Table 26:
Type Resolution Options
Folder ● Merge the contents of the imported duplicate folder with the existing folder.
● Rename the imported duplicate folder.
● Replace the items in the existing folder with those in the duplicate folder.
● Not import the duplicate folder.
You can create folders in the Favorites pane to help you organize your favorites.
Procedure
Context
Note
You cannot use the Organize Favorites menu option to add a favorite to a favorites folder.
Procedure
Context
Note
You cannot use the Organize Favorites menu option to remove a favorite from a favorites folder.
Procedure
You can move a favorite's position on the list up and down or into a folder.
Procedure
Do one of:
Table 27:
Reposition on list Click Move Up and Move Down to reposition the favorite.
Add to folder Click Move and select the folder into which to move the favorite.
Build SELECT statements in the Query Editor, or import existing ones from the SQL Statement pane into the
Query Editor to edit them. When you finish building a query, click OK to export it to the SQL Statement pane to
execute.
You do not need to write SQL code to build queries with the Query Editor. As you define the components of the
query in the Query Editor tabs, the corresponding SQL code is written in the background for you. The Query
Results pane displays the results of the query as it is built. Click SQL at the bottom of the window to see the
SQL code for the query. You can directly edit the SQL code and the Query Editor updates the corresponding
components.
The Query Editor is not designed to create UPDATE statements or other non-SELECT SQL statements. It is not
designed to create views, although you can create them in Interactive SQL and reference them in the Query
Editor. It does not build unions or intersections of SELECT statements.
Use the Query Editor tools and tabs to write a SELECT statement.
Context
The editor can build only one SELECT statement at a time. When you start the Query Editor, the editor
attempts to parse any content in the SQL Statements pane as a valid SELECT statement. If it cannot, you see
an error message, and can open the editor without the text.
If there are multiple SELECT statements in the SQL Statements pane, you can import only one of them by
highlighting the complete statement before starting the Query Editor.
Procedure
1. To:
In this table, a recognizable SELECT statement is a statement that can be successfully parsed by the
Query Editor. It does not have to be able to return valid output or run without error.
Import an existing SELECT statement into If there is only one recognizable SELECT statement in the SQL State
the Query Editor. ments pane, proceed to the next step. If there are multiple statements
in the SQL Statements pane, select one.
Build a new SELECT statement in the Query Ensure the SQL Statements pane is empty or does not contain a single
Editor. recognizable SELECT statement.
2. Do one of:
Tables Lists the tables in the database you can use in your query.
○ Specify a table or owner pattern or table type to filter the list.
○ Select a table in the left pane and click Right to add the table to the query. You
can only add one table at a time.
○ Select a table in the right pane and click Left to remove the table from the
query.
○ To use a derived table in the query, click Create a derived table or press Alt+D.
Joins Specifies a join strategy for combining the data in the tables.
○ If you include more than one table in your query, the Query Editor suggests au
tomatically suggests a join strategy for combining the data in the tables. If there
is a foreign key relationship between the tables, it generates a join condition
based on that relationship, or it suggests a cross product.
○ If you import a SELECT statement that contains a join strategy, the Query Edi
tor accepts exactly the join strategy that you specified (and an unspecified JOIN
is not defaulted to KEY JOIN).
○ Modify the join strategy as need.
○ Click Add to create a new join strategy.
○ To delete a join, left-click the dot at the beginning of the join line and click
Delete.
Columns Specifies the columns in your result set. If you do not select any columns, they are
all used.
○ The left pane lists the tables that are already selected for the query under the
Tables tab.
○ Expand a table in the left pane to display the available columns. Select a column
in the left pane and click Right to add the column to the query. You can only add
one column at a time.
○ To remove a column from the query, select a column in the right pane and click
Left.
○ To reorder the column in the query output, highlight a column in the right pane
and click Up and Down.
○ To use a derived column in the query, click Add a computed column, or press
Alt+C.
WHERE Specifies conditions for restricting the rows in your result set. Type the WHERE
clause in the Criteria pane, click Build WHERE expression or press Alt+C.
HAVING Restricts the rows in your result set based on group values. Type the HAVING clause
in the Criteria pane, click Build HAVING expression or press Alt+C.
Expression Editor (Available on the Columns, WHERE, GROUP BY, HAVING, ORDER BY tabs) Use to
build search conditions or define computed columns.
Derived Table (Available on the Tables tab and Expression Editor) Similar to the Query Editor, use
this tool to create derived tables and subqueries.
Note
If you selected a single SELECT statement before starting the Query Editor, only the highlighted
statement is replaced with the statement from the Query Editor. Otherwise, the entire contents of the
Procedure
Note
You can also access the Query Editor configuration page by clicking Options in the Query Editor.
Table 31:
Setting Description
Fully qualify table and col Use fully qualified table and column names when constructing SELECT statements.
umn names
Quote names Enclose the names of identifiers in double quotation marks when constructing SELECT
statements.
Get list of tables on startup (Default) Automatically populate the list of tables when the Query Editor opens.
Caution
If you are connected to a database with a large number of tables or have a slow
communications link, you may want to disable this option to speed up the opening
of the Query Editor.
3. Click OK.
An execution plan is the set of steps the database server uses to access information in the database related to
a query. The Plan Viewer is a graphical tool to view these plans.
SQL A place for you to type queries that you want to generate plans for. Click Hide SQL
or Show SQL to control the appearance of the pane.
Query Plan A graphical diagram of the plan after you click Get Plan. Click the dropdown arrow
to change the query type.
Details Details about the generated query plan. For multiple-node plans, click each node in
the Query pane to display the corresponding plan details.
Procedure
1. In the SQL Statements pane, enter the SQL statement you want to generate a plan for.
2. Do one of:
Results
The Plan View opens in a new window with your specified query in the SQL pane.
You can view the query optimizer's execution plan for a SQL statement in the Plan Viewer window.
Context
Note
The Get Plan button is inoperative if the SQL pane is empty.
Procedure
Results
Note
If a query plan cannot be generated, you see a message in the bottom pane. Modify the query and click Get
Plan again.
You can customize the appearance of items in the query plan. You can do this before or after generating the
query plan.
Context
Customizations to options in the Plan viewer are retained only for the current database connection session.
Table 33:
Option Description
Statistics level Specifies the type of query execution statistics the database server monitors when the
query is executed. Valid options are:
○ Optimizer estimates only
○ Detailed statistics
○ Detailed and node statistics
Cursor type Specifies the type of cursor used in the plan. The type of cursor you choose affects opti
mizer performance. Valid options are:
○ Asensitive
○ Insensitive
○ Keyset-driven
○ Sensitive
Update status Specifies how the optimizer should treat the given cursor. Valid options are:
○ Read-write
○ Read-only
2. Click Get Plan to generate the graphical plan with your changes.
You can save a query plan for later retrieval. Query plans have a *.saplan file extension.
Prerequisites
Procedure
You can load a saved query plan, make modifications, and regenerate the query plan.
Context
You do not need to be connected to the database the saved query plan was generated for to open a saved
query plan. However, you must be connected before you can regenerate the query plan.
Procedure
Prerequisites
Procedure
Do one of:
You can customize the appearance of the text in the Query pane, including the color, shape, and font of the
output.
Prerequisites
Context
Customizations apply to all generated plans—not just the currently generated plan—and persist beyond the
current database connection.
Procedure
Interactive SQL integrates with third-party source control systems, allowing you to perform many common
source control operations on files from within Interactive SQL.
On Windows, Interactive SQL integrates with most source control products that support the Microsoft
Common Source Code Control API (MSSCCI), including Microsoft Visual SourceSafe. To use source control
products that do not support the MSSCCI API on Windows and other operating systems, specify a command
line to run for each source control action. Output from those commands appears in a log window.
Interactive SQL supports these tasks, as long as the task is supported in the source control product:
If the underlying source control program does not support an action, its corresponding menu item is disabled.
For example, Visual SourceSafe supports all of these actions, but using a custom (command line) source
control system does not support opening a source control project, or running a source control manager.
You should be familiar with the operations of your source control program before attempting to use it from
Interactive SQL.
You must configure Interactive SQL to use source control before you can perform source control actions on
files, such as checking files in and out, comparing different versions of a file, and viewing the history for a file.
If you are running Interactive SQL on a Windows computer that has a source control product that supports the
Microsoft SCC API, you can use that product or use a custom (command line oriented) system.
You can enable source control integration if you are running Interactive SQL on a Windows computer that has
a source control product that supports the Microsoft SCC API.
Prerequisites
Procedure
You can enable source control integration if you are running Interactive SQL on a computer that has a custom
command line oriented source control product.
Prerequisites
Procedure
If you do not specify a command line for an action, the item in the File Source Control menu is
disabled.
7. Click OK once to save the Custom Source Control Options, and again to close the Options window.
Note
If the connected database does not support source control integration, you see an error message, and
source control extensions are disabled.
You can save custom source control options for later retrieval. The export file has a *.cfg extension.
Prerequisites
Procedure
Note
If the connected database does not support source control integration, you see an error message, and
source control extensions are disabled.
You can load custom source control options from a *.cfg file.
Prerequisites
Procedure
Note
If the connected database does not support source control integration, you see an error message, and
source control extensions are disabled.
Some source control products require you to open a source control project before you can perform any other
source control actions.
The exact definition of what a project is depends on the source control system you are using. Typically, it is a
set of files that are under source control, along with a location on your local file system where working copies
of the files are placed. You usually have to provide some credentials, such as a user ID and password, to the
source control system to open a project.
If your source control system supports opening a source control project, the File > Source Control > Open
Source Control > Project menu item is enabled. Choosing this option from the File menu opens a source
control-specific window for opening a project. Once you open a project, you do not have to open it again, even
in subsequent Interactive SQL sessions. The project is opened automatically for you.
Once you open a file in Interactive SQL, use the command on the File menu to check the file out.
Procedure
1. Select File Open and then browse to the file you want to open.
The file status (Checked In, Checked Out, or Not Controlled) appears on the status bar at the bottom of
the Interactive SQL window.
Note
If you are using an SCC-compliant source control system, the status is always accurate. However, if you
use the custom source control system, the status is based on whether the file is read-only or not. A
read-only file is assumed to be checked in, but no assumptions are made about editable files because
they could be either checked out or not controlled.
When you are finished making edits to your file, you can check it back in from Interactive SQL.
Procedure
In addition to opening source control projects, and checking files in and out, Interactive SQL supports several
other source control actions. The availability of these actions depends on the source control system you are
using.
Access these actions from the File Source Control menu in Interactive SQL.
Get Gets the latest copy of the file you currently have open in the SQL Statements pane.
Undo Check Out Discards your working copy of the file, and then downloads the copy of the file that is
in the source control archive.
Compare Versions This action compares the working copy of the file you have opened against the ver
sion in the source control archive.
History Displays a list of source control actions (typically check-ins) that have been made to
the file you have open.
Properties Displays a list of source control properties that are associated with the file you have
opened.
Run Source Control Manager Launches the management program for your source control system. For example, if
you are using Microsoft Visual SourceSafe, this launches Visual SourceSafe Explorer.
Problem: When you start Interactive SQL using the -nogui command line option, and you execute a multiline
statement, only the first line of the statement executes.
In -nogui mode, any SQL text you enter at the command prompt is executed when you press Enter, even if you
specify a command delimiter using the -d switch. Ensure the SQL command is complete before you press
Enter.
Solution: Do not start Interactive SQL using -nogui mode when executing multiline statements.
Related Information
Reference material for SQL statements and SQL options mentioned in this document.
Interactive SQL statements can only be used from within Interactive SQL.
Syntax
CLEAR
Usage
Closes any open result sets and leaves the contents of the SQL Statements pane unchanged.
Side effects:
The CLEAR statement closes the cursor that is associated with the data being cleared.
Permissions
None
Syntax
CONFIGURE
Usage
The dbisql configuration window displays the current settings of all dbisql options. It does not display or let
you modify database options.
If you select Permanent, the options are written to the SYSOPTION table in the database and the database
server performs an automatic COMMIT. If you do not choose Permanent, and instead click OK, options are set
temporarily and remain in effect only for the current database connection.
Permissions
None
Establishes a connection to the database identified by <database-name> running on the server identified by
<engine-name>.
Quick Links:
Syntax
Syntax 1
CONNECT
… [ TO <engine-name> ]
…[ DATABASE <database-name> ]
…[ AS <connection-name> ]
…[ USER ] <userid> [ IDENTIFIED BY ]
Syntax 2
● connect-string a list of parameter settings of the form keyword=<value>, and must be enclosed in single
quotes.
● AS connection can optionally be named by specifying the clause. This allows multiple connections to the
same database, or multiple connections to the same or different database servers, all simultaneously.
Each connection has its own associated transaction. You might even get locking conflicts between your
transactions if, for example, you try to modify the same record in the same database from two different
connections.
Examples
Example 1
Connect to a database from dbisql. You are prompted for user ID and password.
CONNECT
Connect to the default database as DBA, from dbisql. You are prompted to enter a password.
Connect to the demo database as the DBA, from dbisql,where <machine_iqdemo> is the engine name:
CONNECT
TO <machine>_iqdemo
USER "DBA"
IDENTIFIED BY sql
CONNECT
USING 'UID=DBA;PWD=sql;DBN=iqdemo'
Usage
Embedded SQL behavior if no <engine-name> is specified, the default local database server is assumed
(the first database server started). If no <database-name> is specified, the first database on the given
server is assumed.
No other database statements are allowed until a successful CONNECT statement has been executed.
The user ID and password check the permissions on SQL statements. If the password or the user ID and
password are not specified, the user is prompted to type the missing information. By default, the
password is case-sensitive; the user ID is not.
Multiple connections are managed through the concept of a current connection. After a successful connect
statement, the new connection becomes the current one. To switch to a different connection, use SET
CONNECTION. Executing a CONNECT statement does not close the existing connection (if any). Use
DISCONNECT to drop connections.
Static SQL statements use the user ID and password specified with the -l option on the SQLPP statement line.
If no -l option is given, the user ID and password of the CONNECT statement are used for static SQL statements
also.
Standards
Permissions
None
Syntax
Parameters
● ALL drops all of the connections of the application to all database environments.
Examples
Example 1
Example 2
DISCONNECT ALL
The DISCONNECT statement drops a connection with the database server and releases all resources used by it.
If the connection to be dropped was named on the CONNECT statement, the name can be specified.
Standards
Permissions
None
Syntax
OUTPUT TO <filename>
[ APPEND ] [ VERBOSE ]
[ FORMAT output-format ]
[ ESCAPE CHARACTER <character> ]
[ DELIMITED BY <string> ]
[ QUOTE <string> [ ALL ] ]
Parameters
● FORMAT the output format. If no FORMAT clause is specified, the Interactive SQL OUTPUT_FORMAT
database option setting is used.
● TEXT output is a TEXT format file with one row per line in the file. All values are separated by commas, and
strings are enclosed in apostrophes (single quotes). The delimiter and quote strings can be changed using
the DELIMITED BY and QUOTE clauses. If the ALL clause is specified in the QUOTE clause, all values (not
just strings) are quoted. TEXT is the default output format. Three other special sequences are also used.
The two characters \n represent a newline character, \\ represents a single \, and the sequence \xDD
represents the character with hexadecimal code DD.
If you are exporting Java methods that have string return values, you must use the HEXADECIMAL OFF
clause.
● FIXED output is fixed format with each column having a fixed width. The width for each column can be
specified using the COLUMN WIDTHS clause. No column headings are output in this format. If you omit
the COLUMN WIDTHS clause, the width for each column is computed from the data type for the column,
and is large enough to hold any value of that data type. The exception is that LONG VARCHAR and LONG
BINARY data defaults to 32KB.
● SQL output is an Interactive SQL INPUT statement required to re-create the information in the table.
Note
SAP IQ does not support the INPUT statement. Change this statement to a valid LOAD TABLE (or
INSERT) statement to use it to load data back in.
● XML output is an XML file encoded in UTF-8 and containing an embedded DTD. Binary values are encoded
in CDATA blocks with the binary data rendered as 2-hex-digit strings. The LOAD TABLE statement does
not accept XML as a file format.
● APPEND appends the results of the query to the end of an existing output file without overwriting the
previous contents of the file. By default, if you do not use APPEND clause, the OUTPUT statement
overwrites the contents of the output file. The APPEND clause is valid if the output format is TEXT, FIXED,
or SQL.
● VERBOSE error messages about the query, the SQL statement used to select the data, and the data itself
are written to the output file. By default, if you omit the VERBOSE clause, only the data is written to the file.
The VERBOSE clause is valid if the output format is TEXT, FIXED, or SQL.
● DELIMITED BY for the TEXT output format only. The delimiter string, by default a comma, is placed
between columns.
● QUOTE for the TEXT output format only. The quote string, by default a single quote character, is placed
around string values. If ALL is specified in the QUOTE clause, the quote string is placed around all values,
not just around strings.
● COLUMN WIDTHS specifies column widths for the FIXED format output.
● HEXADECIMAL specifies how binary data is to be unloaded for the TEXT format only. When set to ON,
binary data is unloaded in the format 0xabcd. When set to OFF, binary data is escaped when unloaded
(\xab\xcd). When set to ASIS, values are written without any escaping even if the value contains control
characters. ASIS is useful for text that contains formatting characters such as tabs or carriage returns.
● ENCODING specifies the encoding that is used to write the file. You can use the ENCODING clause only
with the TEXT format. Can be a string or identifier. If you do not specify the ENCODING clause, Interactive
SQL determines the code page that is used to write the file as follows, where code page values occurring
earlier in the list take precedence over those occurring later:
● The code page specified with the DEFAULT_ISQL_ENCODING option (if this option is set)
● The default code page for the computer Interactive SQL is running on
Examples
Example 1
Example 2
places the contents of the Employees table at the end of an existing file, and includes any messages about
the query in this file as well:
Example 3
exports a value that contains an embedded line feed character. A line feed character has the numeric
value 10, which you can represent as the string '\x0a' in a SQL statement.
line10x0aline2
line1\x0aline2
If you set HEXADECIMAL to ASIS, the result is a file with two lines:
'line1
line2'
Using ASIS generates two lines, because the embedded line feed character has been exported without
being converted to a two-digit hex representation, and without a prefix.
Usage
The current query is the SELECT or LOAD TABLE statement that generated the information that appears on
the Results tab in the Results pane. The OUTPUT statement reports an error if there is no current query.
Note
OUTPUT is especially useful in making the results of a query or report available to another application, but is
not recommended for bulk operations. For high-volume data movement, use the ASCII and BINARY data
extraction functionality with the SELECT statement. The extraction functionality provides much better
performance for large-scale data movement, and creates an output file you can use for loads.
Side Effects
● In Interactive SQL, the Results tab displays only the results of the current query. All previous query results
are replaced with the current query results.
Standards
Permissions
Syntax
Examples
Example 1
Usage
PARAMETERS specifies how many parameters there are to a command file and also names those parameters
so that they can be referenced later in the command file.
Parameters are referenced by putting the named parameter into the command file where you want the
parameter to be substituted:
{parameter1}
If a command file is invoked with fewer than the required number of parameters, dbisql prompts for values of
the missing parameters.
Standards
Permissions
None
Syntax
Parameters
● ENCODING an identifier or string that specifies encoding that is used to read the file. The READ statement
does not process escape characters when it reads a file. It assumes that the entire file is in the specified
● filename if <filename> has no file extension, Interactive SQL searches for the same file name with the
extension .sql.
If <filename> does not contain an absolute path, Interactive SQL searches for the file. The location of
<filename> is based on the location of the READ statement, as follows:
● If the READ statement is executed directly in Interactive SQL, Interactive SQL first attempts to resolve
the path to <filename> relative to the directory in which Interactive SQL is running. If unsuccessful,
Interactive SQL looks for <filename> in the directories specified in the environment variable
SQLPATH, then the directories specified in the environment variable PATH.
● If the READ statements reside in an external file (for example, a .sql file), Interactive SQL first
attempts to resolve the path to <filename> relative to the location of the external file. If
unsuccessful, Interactive SQL looks for <filename> in a path relative to the directory in which
Interactive SQL is running. If still unsuccessful, Interactive SQL looks in the directories specified in the
environment variable SQLPATH, then the directories specified in the environment variable PATH.
● parameters can be listed after the name of the SQL script file, and correspond to the parameters named
in the PARAMETERS statement at the beginning of the statement file. Parameter names must be enclosed
in square brackets. Interactive SQL substitutes the corresponding parameter wherever the source file
contains { <parameter-name> }.
The parameters passed to a script file can be identifiers, numbers, quoted identifiers, or strings. Any
quotes around a parameter are placed into the text during the substitution. Parameters that are not
identifiers, numbers, or strings (contain spaces or tabs) must be enclosed in square brackets ([ ]). This
allows for arbitrary textual substitution in the script file.
If not enough parameters are passed to the script file, Interactive SQL prompts for values for the missing
parameters.
When executing a reload.sql file with Interactive SQL, you must specify the encryption key as a
parameter. If you do not provide the key in the READ statement, Interactive SQL prompts for the key.
Examples
Example 1
this example reads from the file status.rpt and birthday.sql and passes the parameter values to the
variables within the file:
this example uses the PARAMETERS clause to pass parameters to a script file:
[test1.sql]
PARAMETERS par1, par2;
BEGIN
DECLARE v_par1 int;
DECLARE v_par2 varchar(200)
SET v_par1 = {par1};
SET v_par2 = {par2};
MESSAGE STRING('PAR1 Value: ', v_par1 ) TO CLIENT;
MESSAGE STRING('PAR2 Value: ', v_par2 ) TO CLIENT;
END;
Note
The second parameter value 041028 must be enclosed in quotes, as <v_par2> is declared as a
character data type.
Standards
Permissions
None
Syntax
Examples
Example 1
from dbisql, set the current connection to the connection named “conn1”:
Usage
The current connection state is saved, and resumed when it again becomes the active connection. If you omit
<connection-name>, but a connection exists, that was not named, that connection becomes the active
connection.
Note
When cursors are opened in Embedded SQL, they are associated with the current connection. When the
connection is changed, the cursor names are not accessible. The cursors remain active and in position and
become accessible when the associated connection becomes active again.
Standards
● SQL— dbisql use is a vendor extension to ISO/ANSI SQL grammar. Embedded SQL is a full-level feature.
● SAP Database Products—Supported by Open Client/Open Server.
None
Syntax
Syntax 1
Syntax 2
SET PERMANENT
Syntax 3
SET
Usage
SET PERMANENT (Syntax 2) stores all current dbisql options in the SYSOPTION system table. These settings
are automatically established every time dbisql is started for the current user ID.
Syntax 3 shows all current option settings. If there are temporary options set for dbisql or the database
server, these are shown; otherwise, permanent option settings are shown.
If you incorrectly enter the name of an option when you are setting the option, the incorrect name is saved in
the SYSOPTION table. You can remove the incorrectly enterd name from the SYSOPTION table by setting the
option PUBLIC with an equality after the option name and no value:
The SET ANY PUBLIC OPTION system privilege is required to set database options for another user.
The SET ANY SYSTEM OPTION system privilege is required to set a SYSTEM option for the PUBLIC user ID.
The SET ANY SECURITY OPTION system privilege is required to set a SECURITY option for the PUBLIC user
ID.
Syntax
Parameters
● database-name if not specified, a default name is assigned to the database. This default name is the root
of the database file. For example, a database in file c:\SAP\16_0\demo\iqdemo.db is given the default
name iqdemo.
● engine-name if not specified, the default database server is assumed. The default database server is the
first started server among those that are currently running.
● AUTOSTOP when set to YES (default), the database is unloaded when the last connection to it is dropped.
When set to NO, the database is not unloaded.
Note
Start only one database on a given SAP IQ database server.
Examples
Example 1
on a UNIX system, start the database file /s1/sybase/sample_2.db on the current server:
Example 2
on a Windows system, start the database file c:\sybase\sample_2.db as sam2 on the server eng1:
Usage
The database server must be running. The full path must be specified for the database file unless the file is
located in the current directory.
The START DATABASE statement does not connect dbisql to the specified database you must also issue a
CONNECT statement to make a connection.
Standards
Permissions
Syntax
START ENGINE
AS <engine-name> [ STARTLINE <command-string> ]
Parameters
● command-string valid command strings conform to the database server command line description. See
start_iq Database Server Startup Utility in the Utility Guide.
Examples
Example 1
starts a database server named eng1 without starting any databases on it:
Example 2
starts the same server with a cache of 8096KB:
Several server options are required for SAP IQ to operate well. To ensure that you are using the best options,
start your server by using either SAP IQ Cockpit or a configuration file with the start_iq command.
Standards
Permissions
None
Syntax
● database-name the name specified in the -n parameter when the database is started, or specified in the
DBN (DatabaseName) connection parameter. This name is typically the file name of the database file that
holds the catalog store, without the .db extension, but can be any user-defined name.
● engine-name if not specified, all running engines are searched for a database of the specified name.
● UNCONDITIONALLY if specified, the database is stopped, even if there are connections to the database. If
not specified, the database is not stopped if there are connections to it.
Examples
Example 1
Standards
Permissions
Syntax
Parameters
● UNCONDITIONALLY if specified, the database server is stopped, even if there are connections to the
server. If not specified, the database server is not stopped if there are connections to it.
Examples
Example 1
Standards
Permissions
None
Interactive SQL options are a subset of the SAP IQ SQL options, which change how Interactive SQL interacts
with the database.
Allowed Values
<identifier> or <string>
Default
Scope
Can only be set as a temporary option, for the duration of the current connection.
Remarks
DEFAULT_ISQL_ENCODING specifies the code page to use when reading or writing files. It cannot be set
permanently. The default code page is the default code page for the platform you are running on.
Interactive SQL determines the code page that is used for a particular OUTPUT or READ statement as follows,
where code page values occurring earlier in the list take precedence over those occurring later in the list:
● The code page specified in the ENCODING clause of the OUTPUT or READ statement
● The code page specified with the DEFAULT_ISQL_ENCODING option (if this option is set)
● The default code page for the computer on which Interactive SQL is running
Controls the action taken if an error is encountered while executing statements in Interactive SQL.
Allowed Values
Table 35:
Value Description
STOP Interactive SQL stops executing statements from the file and returns to the state
ment window for input.
CONTINUE Errors appear in the Messages pane, and Interactive SQL continues executing
statements.
NOTIFY_STOP The error is reported, and the user is prompted to stop executing statements.
NOTIFY_EXIT The error is reported, and the user is prompted to terminate Interactive SQL.
Default
PROMPT
Remarks
Controls the action taken, if an error is encountered while executing statements. When you are executing
a .SQL file, the values STOP and EXIT are equivalent.
Enables or prevents users from accessing query plans from the Interactive SQL client or from using SQL
functions to get plans.
Allowed Values
ON, OFF
Default
OFF
Scope
Option can be set at the database (PUBLIC) or user level. At the database level, the value becomes the default
for any new user, but has no impact on existing users. At the user level, overrides the PUBLIC value for that
user only. No system privilege is required to set option for self. System privilege is required to set at database
level or at user level for any user other than self.
Requires the SET ANY SYSTEM OPTION system privilege to set this option. Can be set temporary for an
individual connection or for the PUBLIC role. Takes effect immediately.
Remarks
When QUERY_PLAN_TEXT_ACCESS option is ON, users can view, save, and print query plans from the
Interactive SQL client. When the option is OFF, query plans are not cached, and other query plan-related
database options have no effect on the query plan that is shown from the Interactive SQL client. This error
message appears:
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system
environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and
completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP
intentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be
a binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however,
does not apply in cases of wilful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations of
SAP.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as
"sales person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun
does not exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does
not warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any
damages caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for
transparency (see: http://help.sap.com/disclaimer).