Ivory ORM Docs

Ivory ORM Docs

  • Docs

›SQL Syntax

SQL Syntax

  • First-Steps
  • Select
  • Select Distinct
  • Where
  • And, Or and Not
  • Order By
  • Insert
  • Update
  • Delete
  • Min and Max
  • Count, Avg and Sum
  • Like
  • In
  • Between
  • Alias
  • Joins
  • Union
  • Group By
  • Having
  • Exists
  • Any & All
  • Procedures

Procedures

Procedures

The steps to made and execute a procedure using ivory are very simple and just need a call of method.

Example Create Procedure

require_once('Operations.php');

$ivoryOrm = new Operations();

$arrSelect[] = "name";

$arrWhere[] = [
    "propName" => "name",
    "fieldValue" => "Jon",
];

$tables[] = "aditional_data";

$select = $ivoryOrm->select($arrSelect, $tables);
$select = $ivoryOrm->where($select, $arrWhere);

//the method select creates the query : 
//CREATE PROCEDURE myProcedureName
//AS
//SELECT name FROM aditional_data WHERE name = 'Jon'
//GO; 

$createProcedure = $ivoryOrm->createProcedure("myProcedureName", $select);

//the method runQuery is responsible to literally run your query into the database;
$result = $ivoryOrm->runQuery($selectWhere);

Example Run a Procedure

require_once('Operations.php');

$ivoryOrm = new Operations();

//the method executeProcedure calls the runQuery method automatically 
//so you dont have to call the runQuery method;
$result = $ivoryOrm->executeProcedure("myProcedureName");

//outputs: EXEC myProcedureName;

← Any & All
  • Procedures
  • Example Create Procedure
  • Example Run a Procedure
Repository Link
Copyright © 2020 Kevin da Silva