Skip to content

CALL procedure clause

Marijn van Wezel edited this page Dec 8, 2022 · 8 revisions

The CALL procedure clause accepts a procedure to call and a list of variables to yield.

Query::callProcedure(Procedure|string $procedure, AnyType|bool|float|int|array|Pattern|string|(AnyType|bool|float|int|array|Pattern|string)[] $yields = []): Query

Parameters

  • $procedure: The procedure to call.
  • $yields: The result fields that should be returned.

Examples

$statement = Query::new()
	->callProcedure("apoc.json")
	->build();

$this->assertSame("CALL `apoc.json`()", $statement);
$statement = Query::new()
    ->callProcedure("dbms.procedures", [
        Query::variable('name'),
        Query::variable('signature')
    ])
    ->build();

$this->assertSame("CALL `dbms.procedures`() YIELD name, signature", $statement);
$procedure = Procedure::raw("dbms.security.createUser", ['example_username', 'example_password', false]);
$statement = Query::new()
    ->callProcedure($procedure)
    ->build();

$this->assertSame("CALL `dbms.security.createUser`('example_username', 'example_password', false)", $statement);

External links

Clone this wiki locally