Definition at line 38 of file Ids.php.
◆ __construct()
Construct the data server class.
It will be used to generate non-generic SQL for a particular data server
- Parameters
-
Definition at line 53 of file Ids.php.
◆ _getDataType()
Map number representation of a data type to a string
- Parameters
-
- Returns
- string
Definition at line 161 of file Ids.php.
187 40 =>
"Variable-length opaque type",
191 if ($typeNo - 256 >= 0) {
192 $typeNo = $typeNo - 256;
195 return $typemap[$typeNo];
◆ _getPrimaryInfo()
_getPrimaryInfo |
( |
|
$tabid | ) |
|
|
protected |
Helper method to retrieve primary key column and column location
- Parameters
-
- Returns
- array
Definition at line 205 of file Ids.php.
207 $sql =
"SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6, 208 i.part7, i.part8, i.part9, i.part10, i.part11, i.part12, 209 i.part13, i.part14, i.part15, i.part16 211 JOIN sysconstraints c ON c.idxname = i.idxname 212 WHERE i.tabid = " . $tabid .
" AND c.constrtype = 'P'";
214 $stmt = $this->_adapter->query($sql);
229 foreach (
$row as $key => $colno) {
234 $cols[$colno] = $position;
◆ describeTable()
describeTable |
( |
|
$tableName, |
|
|
|
$schemaName = null |
|
) |
| |
IDS catalog lookup for describe table
- Parameters
-
string | $tableName | |
string | $schemaName | OPTIONAL |
- Returns
- array
The ordering of columns is defined by the query so we can map to variables to improve readability
Definition at line 78 of file Ids.php.
82 $sql=
"SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype, 83 d.default, c.collength, t.tabid 85 JOIN systables t ON c.tabid = t.tabid 86 LEFT JOIN sysdefaults d ON c.tabid = d.tabid AND c.colno = d.colno 88 . $this->_adapter->quoteInto(
'UPPER(t.tabname) = UPPER(?)',
$tableName);
90 $sql .= $this->_adapter->quoteInto(
' AND UPPER(t.owner) = UPPER(?)', $schemaName);
92 $sql .=
" ORDER BY c.colno";
95 $stmt = $this->_adapter->query($sql);
116 $primaryPosition =
null;
122 if (array_key_exists(
$row[$colno], $primaryCols)) {
124 $primaryPosition = $primaryCols[
$row[$colno]];
128 if (
$row[$typename] == 6 + 256 ||
129 $row[$typename] == 18 + 256) {
133 $desc[$this->_adapter->foldCase(
$row[$colname])] = array (
134 'SCHEMA_NAME' => $this->_adapter->foldCase(
$row[$tabschema]),
135 'TABLE_NAME' => $this->_adapter->foldCase(
$row[$tabname]),
136 'COLUMN_NAME' => $this->_adapter->foldCase(
$row[$colname]),
137 'COLUMN_POSITION' =>
$row[$colno],
139 'DEFAULT' =>
$row[$default],
140 'NULLABLE' => (bool) !(
$row[$typename] - 256 >= 0),
141 'LENGTH' =>
$row[$length],
142 'SCALE' => (
$row[$typename] == 5 ?
$row[$length]&255 : 0),
143 'PRECISION' => (
$row[$typename] == 5 ? (
int)(
$row[$length]/256) : 0),
145 'PRIMARY' => $primary,
146 'PRIMARY_POSITION' => $primaryPosition,
147 'IDENTITY' => $identity
◆ lastSequenceId()
lastSequenceId |
( |
|
$sequenceName | ) |
|
IDS-specific last sequence id
- Parameters
-
- Returns
- integer
Definition at line 280 of file Ids.php.
282 $sql =
'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).
'.CURRVAL FROM ' 283 .
'systables WHERE tabid = 1';
284 $value = $this->_adapter->fetchOne($sql);
◆ limit()
limit |
( |
|
$sql, |
|
|
|
$count, |
|
|
|
$offset = 0 |
|
) |
| |
Adds an IDS-specific LIMIT clause to the SELECT statement.
- Parameters
-
string | $sql | |
integer | $count | |
integer | $offset | OPTIONAL |
- Exceptions
-
- Returns
- string
- See also
- Zend_Db_Adapter_Exception
-
Zend_Db_Adapter_Exception
Definition at line 248 of file Ids.php.
253 #require_once 'Zend/Db/Adapter/Exception.php'; 256 $limit_sql = str_ireplace(
"SELECT",
"SELECT * FROM (SELECT", $sql);
257 $limit_sql .=
") WHERE 0 = 1";
259 $offset = intval($offset);
262 #require_once 'Zend/Db/Adapter/Exception.php'; 266 $limit_sql = str_ireplace(
"SELECT",
"SELECT FIRST $count", $sql);
268 $limit_sql = str_ireplace(
"SELECT",
"SELECT SKIP $offset LIMIT $count", $sql);
◆ listTables()
Returns a list of the tables in the database.
- Returns
- array
Definition at line 63 of file Ids.php.
65 $sql =
"SELECT tabname " 68 return $this->_adapter->fetchCol($sql);
◆ nextSequenceId()
nextSequenceId |
( |
|
$sequenceName | ) |
|
IDS-specific sequence id value
- Parameters
-
- Returns
- integer
Definition at line 294 of file Ids.php.
296 $sql =
'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).
'.NEXTVAL FROM ' 297 .
'systables WHERE tabid = 1';
298 $value = $this->_adapter->fetchOne($sql);
◆ $_adapter
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Ibm/Ids.php