DECLARE STATEMENT
DECLARE STATEMENT
DECLARE STATEMENT — declare SQL statement identifier
Synopsis
EXEC SQL [ AT connection_name ] DECLARE statement_name STATEMENTDescription
DECLARE STATEMENT declares an SQL statement identifier. SQL statement identifier can be associated with the connection. When the identifier is used by dynamic SQL statements, the statements are executed using the associated connection. The namespace of the declaration is the precompile unit, and multiple declarations to the same SQL statement identifier are not allowed. Note that if the precompiler runs in Informix compatibility mode and some SQL statement is declared, "database" can not be used as a cursor name.
Parameters
connection_name
A database connection name established by the CONNECT command.
AT clause can be omitted, but such statement has no meaning.
statement_name
The name of an SQL statement identifier, either as an SQL identifier or a host variable.
Notes
This association is valid only if the declaration is physically placed on top of a dynamic statement.
Examples
Compatibility
DECLARE STATEMENT is an extension of the SQL standard, but can be used in famous DBMSs.
See Also
原文:PostgreSQL 15.19 Documentation(英文原文,待翻譯)
Last updated
Was this helpful?