GJC Technical Home Page
Index
About ODBC
Installing ODBC
Interacting with the data
ODBC Syntax
Macros


GJC Technical Home Page


GJC Technical Home Page

Integrating ODBC with WordPerfect for Windows




SQL Syntax

This document provides a starting point only. Please consult one of the many texts on SQL for more information.

You enter your SQL statements into WordPerfect by typing them into the SQL Statement box in the Input Data dialog.

SQL is a standard language for defining and manipuating relationally-stored data. It has two distinct functions: data definition, and data manipulation. Data definition deals with the structure of the data, e.g. which tables, indices, etc. exist, together with the relationships between the tables. Data manipulation deals with the contents of the data tables, i.e. values stored in each of the data rows.

International standards define the SQL language, thus providing a common interface between data servers and the client applications. Some software houses have their own dialects of this language. However, standard SQL2 is recognized by nearly all ODBC drivers.

Data Definition

Examples of the data definition portion of SQL, together with their function, are given in the table below:
    Statement Description
    CREATE TABLE Defines the structure of a data table, including its indexes.
    ALTER TABLE Redefines the structure of a data table, including its indexes.
    CREATE INDEX Creates an index on a specific data table.
    DROP Deletes a table, index or constraint.


Data Manipulation

Examples of the data manipulation portion of SQL, together with their function, are given in the table below:
    Statement Description
    SELECT Retrieves data rows from one or more existing tables.
    INSERT INTO Appends new rows to an existing table.
    UPDATE Updates rows of an existing table.
    DELETE Deletes rows from an existing table
    UNION Merges two results tables into a single table



Data Types

The most common general data types, together with some specific to Microsoft Access, are listed below:

The following data types are defined by ANSI:
Data Type Description Synonyms
CHAR(Length) String data type where Length=max number of characters CHARACTER, TEXT
BOOLEAN True or False LOGICAL
DATE Any valid date  
TIME Any valid time TIMESTAMP
REAL Singe-precision floating point number  
FLOAT Double-precision floating point number  
SMALLINT Short integer (2 bytes)  
INTEGER Long integer (4 bytes)  


Microsoft Access defines the following additional data types:
Data Type Description Synonyms
BYTE 1 byte of data  
COUNTER An automatically incrementing long integer-compatible data type used primarily as a key AUTOINCREMENT, AUTONUMBER
CURRENCY Special data type for financial purposes MONEY
LONGTEXT Textual data which may be over 255 characters in length NOTE, MEMO

NOTE: Date and time formats differ between DBMSs. For example, Access requires dates delimited with hash marks, e.g. '#20/04/1996#'



Index | About ODBC | Installing ODBC | Interacting with the data | SQL Syntax | Macros

© 1997 – GJC Technical Ltd.

Last updated on 21 June 1997


Please email any comments about this site to webmaster@gjctech.co.uk.