mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
added MetaPrimaryKeys for MaxDB
This commit is contained in:
parent
531dbe93c7
commit
38a2ea7768
@ -45,6 +45,13 @@ class ADODB_SAPDB extends ADODB_odbc {
|
|||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function MetaPrimaryKeys($table)
|
||||||
|
{
|
||||||
|
$table = $this->Quote(strtoupper($table));
|
||||||
|
|
||||||
|
return $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos");
|
||||||
|
}
|
||||||
|
|
||||||
function &MetaIndexes ($table, $primary = FALSE)
|
function &MetaIndexes ($table, $primary = FALSE)
|
||||||
{
|
{
|
||||||
$table = $this->Quote(strtoupper($table));
|
$table = $this->Quote(strtoupper($table));
|
||||||
@ -75,13 +82,9 @@ class ADODB_SAPDB extends ADODB_odbc {
|
|||||||
$indexes[$row[0]]['columns'][] = $row[2];
|
$indexes[$row[0]]['columns'][] = $row[2];
|
||||||
}
|
}
|
||||||
if ($primary) {
|
if ($primary) {
|
||||||
$columns = array();
|
|
||||||
foreach($this->GetAll("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos") as $row) {
|
|
||||||
$columns[] = $row['COLUMNNAME'];
|
|
||||||
}
|
|
||||||
$indexes['SYSPRIMARYKEYINDEX'] = array(
|
$indexes['SYSPRIMARYKEYINDEX'] = array(
|
||||||
'unique' => True, // by definition
|
'unique' => True, // by definition
|
||||||
'columns' => $columns,
|
'columns' => $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $indexes;
|
return $indexes;
|
||||||
|
Loading…
Reference in New Issue
Block a user