classFetchCursor
final class FetchCursor
implements ProgramStatement
uses Snapshot
Public API: explicitly declared with
@visibility public.FETCH: reads the next row of an open cursor into local variables.
The optional words NEXT FROM and FROM carry no meaning and are not kept. The facts follow MYSQL-PROGRAM-CURSORS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/fetch.html.
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE PROCEDURE p(OUT a INT) BEGIN DECLARE c CURSOR FOR SELECT 1; FETCH NEXT FROM c INTO a; END');
[$create->statement->body->statements[0]->targets[0]->value, $create->toString()] // => ['a', 'CREATE PROCEDURE p(OUT a INT) BEGIN DECLARE c CURSOR FOR SELECT 1; FETCH c INTO a; END']Properties§
public non-empty-list<Name> $targetspublic Name $cursorMethods§
Parameters
Calls 2
- static-call Check::listOf() line 44
- class-const Name::class() line 44
public function deriveProgram(Derivation $derivation, ProgramScope $scope): voidChecks that the cursor and the variables are declared.
Parameters
$derivation | Derivation | |
$scope | ProgramScope |
Calls 3
- method-call CursorFacts::cursor() line 52
- new CursorFacts line 52
- method-call CursorFacts::variables() line 53
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 61
- class-const NameUse::Identifier() line 61
- method-call Output::symbol() line 64
- method-call Output::name() line 66
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.