[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|       CREATE TABLE - SQL        |
+---------------------------------+
CREATE TABLE | DBF <dbf_name>
        (<fname1> <type> [(<precision>
        [, <scale>])
        [, <fname2> ... ]])
        | FROM ARRAY <array>

-----------------------------------
CREATE TABLE creates a database.
-----------------------------------

Each new database field is defined with a name, type, precision and
scale.  These definitions can be obtained from the command itself or
from an array.  The new database is open exclusively regardless of the
setting of SET EXCLUSIVE.

CREATE TABLE | DBF <dbf_name>
        In this clause, <dbf_name> specifies the name of the database to
create.  The <dbf_name> can include a path and can be a name expression.

(<fname1> <type> [(<precision> [, <scale>] [, <fname2> ... ])
        In this clause, <fname1> and <fname2> are names of fields in the new
database.  Each <fname> can be a name expression.

        <type> is a single letter indicating the data type for the field.  Some
data types require that you specify a <precision> (field width) and
<scale> (number of decimal places).

<type>, <precision> and <scale> may be:

Type  Precision  Scale  Descr.
---------------------------------
C       |         n             |  -   |Char.
    |           |      |string of
    |           |      |width n
----+-----------+------+---------
D       |         -             |  -   |Date
----+-----------+------+---------
F       |         n             |  d   |Float of
    |           |      |width n
    |           |      |with d
    |           |      |decimal
    |           |      |places
----+-----------+------+---------
L       |         -             |  -   |Logical
----+-----------+------+---------
M       |         -             |  -   |Memo
----+-----------+------+---------
N       |         n             |  d   |Numeric of
    |           |      |width n
    |           |      |with d
    |           |      |decimal
    |           |      |places
----+-----------+------+---------
P       |         -             |  -   |Picture
---------------------------------

FROM ARRAY <array>
        In this clause, <array> is the name of an existing array whose contents
are the name, type, precision and scale for each field in the database.
The contents of the array can be defined with the AFIELDS() function.

+---------------------------------+
|             Examples            |
+---------------------------------+
CREATE TABLE employee ;
                (name C(20), addr C(30), city C(30), zip C(5), salary N(8,2), comments
M)

CREATE DBF contacts FROM ARRAY ncontact

-----------------------------------

See Also:  AFIELDS(), CREATE QUERY, INSERT - SQL, MODIFY QUERY, SELECT -
SQL, SQL

-----------------------------------

See Also: AFIELDS() CREATE QUERY INSERT - SQL MODIFY QUERY SELECT -
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson