本文整理汇总了PHP中ForeignKey::setReferenceConstraintName方法的典型用法代码示例。如果您正苦于以下问题:PHP ForeignKey::setReferenceConstraintName方法的具体用法?PHP ForeignKey::setReferenceConstraintName怎么用?PHP ForeignKey::setReferenceConstraintName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ForeignKey
的用法示例。
在下文中一共展示了ForeignKey::setReferenceConstraintName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkTableForeignKeys
/**
* Obtiene el detalle de las foreign keys del esquema
* @return Array
*/
public function checkTableForeignKeys()
{
$sql = "select uc.constraint_name, uc.table_name, ucc.column_name, uc.r_constraint_name, destino.table_name as r_table_name, " . "destino.column_name as r_column_name, uc.status " . "from user_constraints uc " . "inner join user_cons_columns destino on uc.r_constraint_name = destino.constraint_name " . "inner join user_cons_columns ucc on uc.constraint_name = ucc.constraint_name " . "where uc.constraint_type = 'R' " . "and uc.owner = upper(:v_owner) " . "and uc.table_name = upper(:v_table) " . "order by uc.table_name, uc.r_constraint_name, destino.table_name, destino.column_name";
$stmt = oci_parse($this->getConnection(), $sql);
oci_bind_by_name($stmt, ":v_table", $this->objectName);
oci_bind_by_name($stmt, ":v_owner", $this->owner);
if (!@oci_execute($stmt)) {
$e = oci_error();
$this->setMensaje("Error al obtener el detalle de las claves foráneas de la tabla o vista '{$this->objectName}' - {$e['message']}");
$this->setEstado(false);
}
while ($row = oci_fetch_array($stmt, OCI_ASSOC | OCI_RETURN_NULLS)) {
$foreignKey = new ForeignKey();
$foreignKey->setConstraintName($row['CONSTRAINT_NAME']);
$foreignKey->setTableName($row['TABLE_NAME']);
$foreignKey->setColumnName($row['COLUMN_NAME']);
$foreignKey->setReferenceConstraintName($row['R_CONSTRAINT_NAME']);
$foreignKey->setReferenceTableName($row['R_TABLE_NAME']);
$foreignKey->setReferenceColumnName($row['R_COLUMN_NAME']);
$foreignKey->setStatus($row['STATUS']);
$this->aForeignKeys[] = $foreignKey;
}
return $this->aForeignKeys;
}