Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » SQL Anywhere database connections » Database connections

 

Connecting to a database on a local computer (Interactive SQL)

You can connect to a local database using the Interactive SQL utility at a command prompt. You can start and connect to the database and database server, or you can connect to a running database.

Prérequis

Connecting to a database server assumes that a database is running on a database server on your computer. If it isn't already running, start a database server and database. For example, run the following command to start the SQL Anywhere 16 sample database on a database server:

dbsrv16 -n database-name "file path"

There are no prerequisites for this task.

 Task
  • Run the following command to start Interactive SQL and connect to a database:

    Option Action
    Start and connect to a database
    dbisql -c "UID=user-id;PWD=password;ServerName=server-name;DBF=database-file"
    Connect to a running database
    dbisql -c "UID=user-id;PWD=password;ServerName=server-name;DBN=database-name"

Résultat

Interactive SQL is started and connects to the database.

Exemple

Run the following command to start a database server and database and connect to the database from Interactive SQL:

dbisql -c "UID=DBA;PWD=sql;ServerName=mydemo;DBF=%SQLANYSAMP16%demo.db"