Home » Database » DB » Bug #2331
code for function getSpecialQuery($type)
Details
| Request #2331 | code for function getSpecialQuery($type) |
|---|---|
| Submitted | 2004-09-14 19:16 UTC |
| From | raseesink at hotpop dot com |
| Assigned | danielc |
| Status | Closed |
| Package | DB |
| PHP Version | 4.3.8 |
| OS | debian |
| Roadmaps | (Not assigned) |
Comments
[2004-09-14 19:16 UTC] raseesink at hotpop dot com
Description:
------------
Here is some code which implements function getSpecialQuery($type) for ibase.php. Use it at any license of choice.
/**
* Returns the query needed to get some backend info
* @param string $type What kind of info you want to retrieve
* @return string The SQL query string
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'tables':
// Is this correct?
$sql="SELECT DISTINCT R.RDB\$RELATION_NAME FROM RDB\$RELATION_FIELDS R WHERE R.RDB\$SYSTEM_FLAG=0";
break;
default:
case 'views':
// Is this correct?
$sql="SELECT DISTINCT RDB\$VIEW_NAME from RDB\$VIEW_RELATIONS";
break;
default:
case 'users':
// Is this correct?
$sql="SELECT DISTINCT RDB\$USER FROM RDB\$USER_PRIVILEGES";
break;
case 'databases':
// Database not capable?
return $this->raiseError(DB_ERROR_UNSUPPORTED);
break;
default:
return $this->raiseError(DB_ERROR_UNSUPPORTED);
}
return $sql;
}