InterBase Quick Start: Introduction

From InterBase
Jump to: navigation, search

Go Up to InterBase Quick Start

This Quick Start tutorial takes you step-by-step through the process of creating and using a database. You learn to create data structures that enforce referential integrity constraints and maintain security. You populate your tables, create triggers and stored procedures, and learn a number of techniques for retrieving the data with precision. Instructions assume that you use the interactive SQL window of the IBConsole but you may use the command-line isql instead. If you use the command-line isql, you may need to modify the provided code.

There are five parts in this tutorial:

Using this Quick Start

This tutorial guides you to enter SQL statements manually and by using prepared SQL scripts. This way you get both hands-on experience and you get to work with a fairly complex database.

Getting the SQL Scripts

To obtain the SQL script files, download the compressed (ZIP) archive: InterBase Quick Start Scripts, ZIP. You see this link again when you reach the first step that requires you to use an SQL script.

Image 025.jpgSteps That Require User Action

Topics that require you to take action, for example execute a statement or run a script, are marked with a green triangle symbol (Image 025.jpg). If you see a code snippet or a definition in a topic that is not marked with Image 025.jpg, do not execute that code.

Typographic Conventions

The Quick Start follows these typographic conventions:

Convention Purpose Example

UPPERCASE

SQL keywords, SQL functions, and names of all database objects such as tables, columns, indexes, and stored procedures.

The SELECT statement retrieves data from the CITY column in the CITIES table. The CAST() function can be used in CHAR, VARCHAR, and BLOB text columns.

highlighted

Emphasized words, elements from host languages, and user-supplied items.

  • isc_decode_date()
  • isql

bold

File names, menu commands, and all commands that are entered at a system prompt, including their switches, arguments, and parameters.

  • A script, ib_udf.sql, in the examples subdirectory.
  • The employee.gdb database file.
  • The Session > Advanced Settings command.

Syntax Conventions

The Quick Start follows these conventions for syntax, code snippets and definitions:

Convention Purpose Example

UPPERCASE

Keywords that must be typed exactly as they appear when used.

  • SET TERM !!
  • ADD [CONSTRAINT] CHECK

lowercase

User-supplied parameters that cannot be broken into smaller units.

CREATE TRIGGER name FOR table ALTER EXCEPTION name message

<lowercase>

Parameters in angle brackets can be broken into smaller syntactic units; the expansion syntax for these parameters follows the current syntax statement.

WHILE (<condition>) DO <compound_statement> 33

[]

Optional syntax. You do not need to include anything that is enclosed in square brackets. If elements within brackets are separated by a pipe symbol, you can choose only one element.

CREATE [UNIQUE][ASCENDING | DESCENDING][FILTER [FROM subtype] TO subtype]

{}

You must include one and only one of the enclosed options, which are separated by the pipe symbol |.

{INTO | USING}

|

You can choose only one of a group whose elements are separated by a pipe symbol.

SELECT [DISTINCT | ALL]

...

You can repeat the clause enclosed in brackets with the ... symbol as many times as necessary.

(<col>[,<col>...])

Reading and Typing Capitals

Type of entry Case Sensitivity

SQL Statements

When you enter SQL statements into the interactive SQL window of the IBConsole, you may ignore the case. The conventions listed above are meant for readability.

Strings

Strings (anything in quotation marks) are case sensitive. There are many strings in single quotes in this Quick Start, and you must enter the string exactly as provided.

External References

When you refer to something outside of InterBase, such as a filename, the reference is case sensitive.

Line Breaks

  • Example statements contain line breaks to make them easy to read and understand. Line breaks are not required. InterBase ignores line breaks in SQL statements.

Advance To: