final class CloseCursor
    implements ProgramStatement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CLOSE: closes an open cursor.

The facts follow MYSQL-PROGRAM-CURSORS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/close.html.

Reading the cursor a CLOSE namesdoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE PROCEDURE p() BEGIN DECLARE c CURSOR FOR SELECT 1; CLOSE c; END');
    [$create->statement->body->statements[0]->cursor->value, $create->facts->diagnostics] // => ['c', []]

Properties§

public Name $cursor

Methods§

public function __construct(public Name $cursor)

Parameters

$cursorNameThe cursor name
public function deriveProgram(Derivation $derivation, ProgramScope $scope): void

Checks that the cursor is declared.

Parameters

$derivationDerivation
$scopeProgramScope
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 2

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Type declarations 1