Postgresql 中文操作指南

OPEN

OPEN — 打开动态游标

OPEN — open a dynamic cursor

Synopsis

OPEN cursor_name
OPEN cursor_name USING value [, ... ]
OPEN cursor_name USING SQL DESCRIPTOR descriptor_name

Description

OPEN 打开一个游标,并选择将实际值绑定到游标声明中的占位符。必须使用 DECLARE 命令预先声明该游标。 OPEN 的执行导致该查询开始在服务器上执行。

OPEN opens a cursor and optionally binds actual values to the placeholders in the cursor’s declaration. The cursor must previously have been declared with the DECLARE command. The execution of OPEN causes the query to start executing on the server.

Parameters

  • cursor_name #

    • The name of the cursor to be opened. This can be an SQL identifier or a host variable.

  • value #

    • A value to be bound to a placeholder in the cursor. This can be an SQL constant, a host variable, or a host variable with indicator.

  • descriptor_name #

    • The name of a descriptor containing values to be bound to the placeholders in the cursor. This can be an SQL identifier or a host variable.

Examples

EXEC SQL OPEN a;
EXEC SQL OPEN d USING 1, 'test';
EXEC SQL OPEN c1 USING SQL DESCRIPTOR mydesc;
EXEC SQL OPEN :curname1;

Compatibility

SQL 标准中规定了 OPEN

OPEN is specified in the SQL standard.

See Also