private function GetConstraintRules($constraintName, ConstraintRule &$onUpdate = null, ConstraintRule &$onDelete = null)
    {
        $sql = new Sql\Builder($this);
        $tbl = $sql->Table('information_schema.REFERENTIAL_CONSTRAINTS', array('CONSTRAINT_NAME', 'UPDATE_RULE', 'DELETE_RULE'));
       
        $where = $sql->Equals($tbl->Field('CONSTRAINT_NAME'), $sql->Value($constraintName));
        $selectList = $sql->SelectList($tbl->Field('UPDATE_RULE'));
        $selectList->Add($tbl->Field('DELETE_RULE'));
        $select = $sql->Select(false, $selectList, $tbl, $where);
        $reader = $this->ExecuteQuery((string) $select);
        if ($reader->Read())
        {
            $onUpdate = ConstraintRule::ByValue($reader->ByName('UPDATE_RULE'));
            $onDelete = ConstraintRule::ByValue($reader->ByName('DELETE_RULE'));
        }
    }
private function GetConstraintRules($constraintName, ConstraintRule &$onUpdate = null, ConstraintRule &$onDelete = null)
    {
        $sql = new Sql\Builder($this);
        $tbl = $sql->Table('information_schema.REFERENTIAL_CONSTRAINTS', array('CONSTRAINT_NAME', 'UPDATE_RULE', 'DELETE_RULE'));
       
        $where = $sql->Equals($tbl->Field('CONSTRAINT_NAME'), $sql->Value($constraintName));
        $selectList = $sql->SelectList($tbl->Field('UPDATE_RULE'));
        $selectList->Add($tbl->Field('DELETE_RULE'));
        $select = $sql->Select(false, $selectList, $tbl, $where);
        $reader = $this->ExecuteQuery((string) $select);
        if ($reader->Read())
        {
            $onUpdate = ConstraintRule::ByValue($reader->ByName('UPDATE_RULE'));
            $onDelete = ConstraintRule::ByValue($reader->ByName('DELETE_RULE'));
        }
    }
private function GetConstraintRules ( $ constraintName , ConstraintRule & $ onUpdate = null , ConstraintRule & $ onDelete = null ) { $ sql = new Sql \ Builder ( $ this ) ; $ tbl = $ sql -> Table ( 'information_schema.REFERENTIAL_CONSTRAINTS' , array ( 'CONSTRAINT_NAME' , 'UPDATE_RULE' , 'DELETE_RULE' ) ) ; $ where = $ sql -> Equals ( $ tbl -> Field ( 'CONSTRAINT_NAME' ) , $ sql -> Value ( $ constraintName ) ) ; $ selectList = $ sql -> SelectList ( $ tbl -> Field ( 'UPDATE_RULE' ) ) ; $ selectList -> Add ( $ tbl -> Field ( 'DELETE_RULE' ) ) ; $ select = $ sql -> Select ( false , $ selectList , $ tbl , $ where ) ; $ reader = $ this -> ExecuteQuery ( ( string ) $ select ) ; if ( $ reader -> Read ( ) ) { $ onUpdate = ConstraintRule :: ByValue ( $ reader -> ByName ( 'UPDATE_RULE' ) ) ; $ onDelete = ConstraintRule :: ByValue ( $ reader -> ByName ( 'DELETE_RULE' ) ) ; } }
Gets constraint rules for a foreign key constraint
@param string $constraintName The constraint name as input parameter
@param ConstraintRule $onUpdate The update rule as output parameter
@param ConstraintRule $onDelete The delete rule as output parameter
Gets constraint rules for a foreign key constraint