Contents IndexSET CONNECTION HLI Statement STOP USING DATABASE HLI Statement

User's Guide
   Part V. The SQL Anywhere Programming Interfaces
     Chapter 38. The WSQL HLI Interface
      START USING DATABASE HLI Statement

Syntax

     1. START USING DATABASE [ engine-name:database-name ]

         ...     [ AS connection-name ] [ USER ] userid

         ...     IDENTIFIED BY password

     

     2. START USING DATABASE connect-string

     engine-name:    identifier, or host variable

     database-name:    identifier, or host variable

     connection-name:    identifier, or host variable

     userid:    identifier, or host variable

     password:    identifier, or host variable

Purpose

Form 1: to establish a connection to a database engine or server. Form 2: to start a new database on an existing engine or server.

See also

STOP USING DATABASE, SET CONNECTION.

Description

Form 1 of the START USING DATABASE statement establishes a connection to a database engine or server. If database is omitted then WSQL HLI connects to the default database environment. If there is no such database environment then this command fails.

You can optionally name the connection. This is useful if you wish to simultaneously use more than one connection to the same or different database engines or servers.

This command is functionally similar to the Embedded SQL command CONNECT. See "CONNECT statement".

Form 2 of the START USING DATABASE statement with a connection string does not try to connect to this starting database; it merely starts it. The connection string specifies the database. For a description of connection strings, see "Database connection parameters".

To connect to the database, once it is started, use the START USING DATABASE statement a second time, with form 1.

Examples

The following statement starts the sample database on the currently running server or engine server_name:

     START USING DATABASE "eng=server_name;dbf=c:\sqlany50\sademo.db"

The following two statements start and then connect to the sample database on the currently running server or engine server_name:

     START USING DATABASE "eng=server_name;dbf=c:\sqlany50\sademo.db"
     START USING DATABASE server_name:sademo
     AS conn1 USER dba IDENTIFIED BY sql

Contents IndexSET CONNECTION HLI Statement STOP USING DATABASE HLI Statement