classCursorDeclaration
final class CursorDeclaration
implements Declaration
uses Snapshot
Public API: explicitly declared with
@visibility public.DECLARE ... CURSOR FOR: a named cursor over the rows of a query.
The query is derived where the cursor is declared, with the variables declared before it in scope (MYSQL-PROGRAM-BLOCK-001). Source: https://dev.mysql.com/doc/refman/8.4/en/declare-cursor.html.
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE PROCEDURE p() BEGIN DECLARE c CURSOR FOR SELECT a FROM t; END');
$create->statement->body->declarations[0]->name->value // => 'c'Properties§
public Name $namepublic Query $queryMethods§
public function render(Output $out): voidWrites the declaration.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 43
- class-const NameUse::Identifier() line 43
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.