Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Db_Adapter_Pdo_Ibm_Db2 Class Reference

Public Member Functions

 __construct ($adapter)
 Construct the data server class.
 
 listTables ()
 Returns a list of the tables in the database.
 
 describeTable ($tableName, $schemaName=null)
 DB2 catalog lookup for describe table.
 
 limit ($sql, $count, $offset=0)
 Adds a DB2-specific LIMIT clause to the SELECT statement.
 
 lastSequenceId ($sequenceName)
 DB2-specific last sequence id.
 
 nextSequenceId ($sequenceName)
 DB2-specific sequence id value.
 

Protected Attributes

 $_adapter = null
 

Constructor & Destructor Documentation

__construct (   $adapter)

Construct the data server class.

It will be used to generate non-generic SQL for a particular data server

Parameters
Zend_Db_Adapter_Abstract$adapter

Member Function Documentation

describeTable (   $tableName,
  $schemaName = null 
)

DB2 catalog lookup for describe table.

Parameters
string$tableName
string$schemaNameOPTIONAL
Returns
array

To avoid case issues, fetch using FETCH_NUM

The ordering of columns is defined by the query so we can map to variables to improve readability

In IBM DB2, an column can be IDENTITY even if it is not part of the PRIMARY KEY.

lastSequenceId (   $sequenceName)

DB2-specific last sequence id.

Parameters
string$sequenceName
Returns
integer
limit (   $sql,
  $count,
  $offset = 0 
)

Adds a DB2-specific LIMIT clause to the SELECT statement.

Parameters
string$sql
integer$count
integer$offsetOPTIONAL
Exceptions
Zend_Db_Adapter_Exception
Returns
string
See Also
Zend_Db_Adapter_Exception
Zend_Db_Adapter_Exception

DB2 does not implement the LIMIT clause as some RDBMS do. We have to simulate it with subqueries and ROWNUM. Unfortunately because we use the column wildcard "*", this puts an extra column into the query result set.

listTables ( )

Returns a list of the tables in the database.

Returns
array
nextSequenceId (   $sequenceName)

DB2-specific sequence id value.

Parameters
string$sequenceName
Returns
integer

Member Data Documentation

$_adapter = null
protected