Sybase 12.4.2 Step-by-step overview of database setup, Using Dbisql to work with database objects

Models: 12.4.2

1 536
Download 536 pages 20.34 Kb
Page 121
Image 121

CHAPTER 3 Working with Database Objects

This chapter is concerned with the SQL statements for working with database objects. If you are using Sybase Central, these SQL statements are generated for you. The primary source of information about Sybase Central is the Sybase Central online Help. This chapter gives only brief pointers for tasks that you can carry out using Sybase Central.

For an introduction to using Sybase Central, see “Managing Databases with

Sybase Central” in Introduction to Adaptive Server IQ.

Using DBISQL to work with database objects

Interactive SQL (DBISQL) is a utility for entering SQL statements. If you are using DBISQL to work with your database schema, instead of executing the SQL statements one at a time, build up the set of commands in a DBISQL command file. Then you can execute this file in DBISQL to build the database.

If you use a tool other than DBISQL, all the information in this chapter concerning SQL statements still applies.

DBISQL command file A DBISQL command file is a text file with semicolons placed at the end of commands as shown below.

CREATE TABLE t1 ( .. ); CREATE TABLE t2 ( .. );

CREATE LF INDEX i2 ON t2 ( .. );

..

A DBISQL command file usually carries the extension .sql. To execute a command file, either paste the contents of the file into the DBISQL command window (if the file has less than 500 lines) or enter a command that reads the file into the command window. For example, the command:

read makedb

reads the DBISQL commands in the file makedb.sql.

For more information about reading a file into the command window, see the

READ statement in the Adaptive Server IQ Reference Manual.

A step-by-step overview of database setup

Creating an IQ database is part of a larger setup process that begins with installation and ends when your database is available to users. This section summarizes the steps in setting up an IQ database and the objects in it.

101

Page 121
Image 121
Sybase 12.4.2 manual Step-by-step overview of database setup, Using Dbisql to work with database objects, 101