classExecute
final class Execute
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.EXECUTE: runs a prepared statement with user variables for its parameter markers.
Rule: MYSQL-EXECUTE-001. The prepared statement is a session object; what it does and whether it returns rows depends on the text it was prepared from, so the statement records no rows. The variables are derived as session values. Terminates: one pass over the variables. Source: https://dev.mysql.com/doc/refman/8.4/en/execute.html. Status: Implemented.
$execute = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('EXECUTE stmt USING @a, @b');
[count($execute->statement->variables), $execute->toString()] // => [2, 'EXECUTE stmt USING @a, @b']Properties§
public list<UserVariable> $variablespublic Name $nameMethods§
public function __construct(public Name $name, list<UserVariable> $variables = [])Parameters
$name | Name | The name of the prepared statement |
$variables | list<UserVariable> | The variables that supply the parameter values |
Calls 2
- static-call Check::listOf() line 45
- class-const UserVariable::class() line 45
public function deriveStatement(Derivation $derivation): voidDerives the variables; the statement records no rows.
Parameters
$derivation | Derivation |
Calls 2
- method-call Derivation::scalar() line 54
- method-call Derivation::environment() line 54
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 63
- class-const NameUse::Label() line 63
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.