Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > SELECT >

Error Checking

If the data type of the receiving variable does not match that of the selected item, the data type of the selected item is converted, if possible, to the data type of the variable. If the conversion is impossible, an error occurs, and a negative value is returned in the status variable, sqlca.sqlcode, or SQLCODE. In this case, the value in the program variable is unpredictable.

In an ANSI-compliant database, if the number of variables that are listed in the INTO clause differs from the number of items in the select list of the Projection clause, you receive an error.

Warnings in ESQL/C

In ESQL/C, if the number of variables listed in the INTO clause differs from the number of items in the Projection clause, a warning is returned in the sqlwarn structure: sqlca.sqlwarn.sqlwarn3. The actual number of variables that are transferred is the lesser of the two numbers. For information about the sqlwarn structure, see the IBM Informix ESQL/C Programmer's Manual.

FROM Clause

The FROM clause lists the table objects from which you are selecting the data.

Read syntax diagramSkip visual syntax diagramFROM Clause:
 
|--FROM--------------------------------------------------------->
 
     .-,---------------------------------------------------------------------------------.
     V                                                                                   |
>--+---+-| Table Reference |--+------------------------------------------------------+-+-+-+--|
   |   |                      |    .-,---------------------------------------------. | |   |
   |   |                      |    V                                     (1)  (2)  | | |   |
   |   |                      '-,----| Informix-Extension OUTER Clause |-----------+-' |   |
   |   | .-,---------------------------------------------.     .-,-------------------. |   |
   |   | V                                     (1)  (2)  |     V                     | |   |
   |   '---| Informix-Extension OUTER Clause |-----------+--,----| Table Reference |-+-'   |
   | .-,----------------------------------.                                                |
   | V                          (3)  (4)  |                                                |
   '---| ANSI Table Reference |-----------+------------------------------------------------'
 
Table Reference:
 
|--+-+------------------------+--+--------------+--+-| Relation |--+--------------------+-+-+--|
   | |  (5)                   |  |  (5)         |  |               '-+---------+--alias-' | |
   | '--------num--SAMPLES OF-'  '--------LOCAL-'  |                 |    (2)  |          | |
   |                                               |                 '-AS------'          | |
   |                                               |  (2)    (4)                (6)       | |
   |                                               '---------------| Iterator |-----------' |
   |                              (7)  (2) (4) (8) (9)                                      |
   '-| Collection-Derived Table |-----------------------------------------------------------'
 
Relation:
 
|--+-table----------------------+-------------------------------|
   +-view-----------------------+
   +-synonym--------------------+
   |  (5)                       |
   +--------external------------+
   |  (5)                       |
   +--------(subquery)----------+
   |  (4)                       |
   '--------ONLY--+-(synonym)-+-'
                  '-(table)---'
 

Notes:
  1. See Informix-Extension Outer Joins
  2. Informix extension
  3. See ANSI Table Reference
  4. Dynamic Server only
  5. Extended Parallel Server only
  6. See Iterator Functions (IDS)
  7. See Collection-Derived Table
  8. Stored Procedure Language only
  9. ESQL/C only

Element Description Restrictions Syntax
alias Temporary name for a table or view in this query See The AS Keyword. Identifier
external External table from which to retrieve data Must exist but cannot be the outer table in an outer join Database Object Name
num Number of rows to sample Unsigned integer > 0 Literal Number
subquery Specifies rows to be retrieved Cannot be a correlated subquery SELECT
synonym, table, view Synonym for a table from which to retrieve data Synonym and table or view to which it points must exist Database Object Name

If the FROM clause specifies more than one data source, the query is called a join, because its result set can join rows from several table references. For more information about joins, see Queries that Join Tables.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]