Oracle7 Server SQL Reference

Contents Index Home Previous Next

DECLARE TABLE (Embedded SQL)

Purpose

To define the structure of a table or view, including each column's datatype, default value, and NULL or NOT NULL specification for semantic checking by the Oracle Precompilers.

Prerequisites

None.

Syntax

Keywords and Parameters

table

is the name of the declared table.

column

is a column of the table.

datatype

is the datatype of a column. For information on Oracle7 datatypes, see the section "Datatypes" [*].

DEFAULT

specifies the default value of a column.

NULL

specifies that a column can contain nulls.

NOT NULL

specifies that a column cannot contain nulls.

WITH DEFAULT

is supported for compatibility with IBM's DB2 database.

Usage Notes

For information on using this command, see Programmer's Guide to the Oracle Precompilers.

Example

The following statement declares the PARTS table with the PARTNO, BIN, and QTY columns:

EXEC SQL DECLARE parts TABLE 
	(partno  NUMBER  NOT NULL, 
	 bin     NUMBER, 
	 qty     NUMBER) 

Related Topics

None.


Contents Index Home Previous Next