Progress
Embedded SQL-92
Guide and Reference
SELECT Statement for a Single Row
Returns no more than one row in the result table. Use this statement in embedded SQL-92 programs to assign the values of a single row result table directly to host variables. The syntax for the single row form is similar to the general form of a SELECT statement, with these limitations:
SYNTAX
SELECT [ ALL | DISTINCT ]
If you specify the
DISTINCT
keyword, duplicate rows will be eliminated from the rows retrieved by the system. The default action is that all selected rows are returned.INTO
In the single row form of the
SELECT
statement, the selected values are assigned to the host variables specified in theINTO
clause. TheINTO
clause is required, and it must precede theFROM
clause. If no rows are selected, the SQL_NOT_FOUND condition is returned in the SQLCA structure.FROM
The
FROM
clause is required. If the same column name exists in more than one table specified in theFROM
clause, you must qualify the column name with the table name or a table alias name.WHERE
Specifies the selection criteria for rows. If you do not specify a
WHER
E clause, all the rows of the Cartesian product of all the tables in theFROM
clause are returned.GROUP BY
Specifies the groups of rows returned by the
SELECT
statement. For more information, see the “Query Expressions” section in Chapter 2, “SQL-92 Language Elements,” of the Progress SQL-92 Guide and Reference .HAVING
Allows you to set conditions on the groups returned by a
SELECT
statement. For more information, see the “SELECT” reference section in Chapter 3, “SQL-92 Language Statements”, of the Progress SQL-92 Guide and Reference .ORDER BY
Allows you to specify the order in which the
SELECT
statement returns rows.FOR UPDATE
Specifies which rows are to be updated.
NOTES
- For complete information on Search Conditions and Query Expressions, see Chapter 2, “SQL-92 Language Elements,” in the Progress SQL-92 Guide and Reference .
- For complete information on the SELECT statement, see Chapter 3, “SQL-92 Statements,” in the Progress SQL-92 Guide and Reference .
AUTHORIZATION
The user executing this statement must have at least one of the following privileges:
SQL COMPLIANCE
SQL-92
ENVIRONMENT
Embedded SQL-92 only
RELATED STATEMENTS
None
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |