Firebird 2.0
PSQL Reference
Manual

SELECT INTO STATEMENT

Pupose

Use the SELECT INTO statement to retrieve a single row from a table. The PSQL select statement is identical to the SQL select statement followed by an INTO clause and a semicolon.

Syntax

<psql_select_stmt> ::=
   <select_stmt> INTO <var_list> ;

<var_list> ::=
     <variable_name>
   | <variable_name> , <var_list>

<variable_name> ::=   <identifier>


Element
Description
select_stmt

A SQL insert statement as defined in the SQL Reference manual.

variable_name

The name of a local variable of the enclosing body or of a parameter of the enclosing procedure definition.

Semantics

See the SQL Reference Manual for a description of the select statement.

The select statement must return exactly one row. If it returns zero or more than one row, a run-time error occurs.

Examples

The below is an example of a valid INSERT statement in PSQL:

   SELECT COUNT(*) FROM rdb$relations INTO :table_count


See also

DELETE, UPDATE and INSERT


previous page goto index next page

Legal information