Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
DALDb2Converter Class Reference
Inheritance diagram for DALDb2Converter:
DALConverter

Public Member Functions

 __construct ()
 
 handleFunctionTableExists ($tableName)
 
 handleFunctionSequenceExists ($sequenceName)
 
- Public Member Functions inherited from DALConverter
 getDataType ($type)
 
 getName ()
 
 getConstructName ($name)
 
 convertToSql (array $sqlArray)
 
 convertCreateTable (array $table)
 
 convertDropTable ($tableName, $cascade=FALSE)
 
 convertTruncateTable ($tableName)
 
 convertDropSequence ($sequenceName)
 
 convertResetSequence ($sequenceName)
 
 handleFunctionTableExists ($tableName, $schema=NULL)
 

Protected Member Functions

 handleFunctionSeqNextVal ($seqName)
 
 handleFunctionSeqCurrVal ($seqName)
 
 handleFunctionToDate (array $args)
 
 getUnionType (array $union)
 
 convertUnionDisplayName ($type)
 
 handleFunctionConcat (array $args)
 
 convertLikeCondition (array $condition)
 
 handleFunctionBindcast (array $args)
 
 handleFunctionSubstring (array $args)
 
- Protected Member Functions inherited from DALConverter
 convertSelectQuery (array $sqlArray, $level=0, array $ignore=array())
 
 addSqlFilters (array $sqlArray)
 
 convertSelectFieldList (array $fields, $level=1)
 
 convertSingleField ($field)
 
 getSelectFieldName (array $field)
 
 setSelectFieldAlias (array $field, $alias)
 
 getSelectFieldNames (array $fields)
 
 convertField (array $field)
 
 convertSingleValue ($field)
 
 convertSingleFunction (array $function)
 
 convertFromList (array $from, $level=1)
 
 convertTableAlias ($alias)
 
 convertMathOperation (array $mathOp)
 
 separateFields (array $fields)
 
 separateTables (array $tables)
 
 convertWhereClause (array $where, $level=0, $addBrackets=TRUE)
 
 convertInCondition (array $in, $level=0, $type='IN')
 
 convertExistsCondition (array $exists, $level=0, $type='EXISTS')
 
 convertIsNull (array $isNull)
 
 convertNotNull (array $notNull)
 
 convertUnionsInFromClause (array $union, $level=0)
 
 getUnionType (array $union)
 
 convertUnions (array $union, $level=1)
 
 convertUnionDisplayName ($type)
 
 convertGroupBy (array $groupBy)
 
 convertOrderBy (array $orderBy)
 
 convertLimit (array $limit)
 
 convertJoins (array $joins)
 
 convertSingleJoin (array $join)
 
 convertInsertQuery (array $sqlArray)
 
 addSpaces ($level=0, $spaces=4)
 
 convertInsertQueryFields (array $fields)
 
 convertInsertQueryValues (array $insert)
 
 convertUpdateQuery (array $sqlArray)
 
 convertUpdateQuerySetValues (array $values)
 
 convertDeleteQuery (array $sqlArray)
 
 convertAlterQueryHeader ($tableName)
 
 convertAlterQuery (array $sqlArray)
 
 convertAlterQueryAddColumn (array $addColumn)
 
 convertAlterQueryDropColumn ($column)
 
 convertAlterQueryRenameColumn (array $renameColumn)
 
 convertAlterQueryModifyColumn (array $modifyColumns)
 
 convertAlterQueryAddConstraint (array $constraints, $tableName=NULL)
 
 convertAlterQueryDropConstraint ($dropConstraint)
 
 convertAlterQueryRenameTable (array $renameTable)
 
 convertCreateHeader (array $table)
 
 convertCreateFooter (array $table)
 
 convertCreateColumns (array $table)
 
 convertSingleCreateColumn (array $col)
 
 convertConstraints (array $constraintsList, $asArray=FALSE)
 
 convertSinglePrimaryKey (array $pk)
 
 convertSingleForeignKey (array $fk)
 
 convertSingleUnique (array $un)
 
 convertCreateIndexes (array $table)
 
 convertSingleIndex (array $idx, $tableName)
 
 convertCreateSequences (array $sequences)
 
 convertSingleSequence ($sequence)
 
 convertWithQuery (array $withQuery)
 
 convertCallQuery (array $callQuery)
 
 handleFunctionConcat (array $args)
 
 handleFunctionArray (array $args)
 
 convertLikeCondition (array $condition)
 
 handleFunctionCast (array $args)
 
 handleFunctionBindcast (array $args)
 
 handleFunctionLength (array $args)
 
 handleFunctionCoalesce (array $args)
 
 handleFunctionMax (array $args)
 
 handleFunctionMin (array $args)
 
 handleFunctionCount (array $args)
 
 handleFunctionSubstring (array $args)
 
 getComparisonOperators ($type=NULL)
 

Protected Attributes

 $name = 'DB2'
 
 $dataTypes
 
- Protected Attributes inherited from DALConverter
 $dataTypes
 
 $sqlConstructs
 
 $mathOps
 
 $query = array()
 
 $name = ''
 

Detailed Description

DALDb2Converter.

Contains methods to perform any database specific conversions into SQL. The methods to convert XML structures into SQL are defined in the parent class "DALConverter", and if any conversions need to be altered for this database the corresponding methods of DALConverter should be redefined here.

Since
4.0.0

Definition at line 25 of file DALDb2Converter.inc.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Since
4.0.0

Definition at line 66 of file DALDb2Converter.inc.

Member Function Documentation

convertLikeCondition ( array  $condition)
protected

Handles LIKE conditions.

Parameters
array$conditionThe condition information.
Since
4.0.0
Returns
string

Definition at line 235 of file DALDb2Converter.inc.

convertUnionDisplayName (   $type)
protected

DB2 needs to use UNION ALL (no hyphen) so return that here.

Parameters
string$typeThe type of the union (UNION or UNION-ALL).
Since
4.0.0
Returns
string

Definition at line 200 of file DALDb2Converter.inc.

getUnionType ( array  $union)
protected

Returns the type of the union.

Parameters
array$unionArray of a union/union-all.
Since
4.0.0
Returns
string

Definition at line 178 of file DALDb2Converter.inc.

handleFunctionBindcast ( array  $args)
protected

Handles the BINDCAST() function call.

BINDCAST is used to wrap bind vars. For DB2 bind vars must be cast to a valid data type if they are used in a SELECT or as function argument.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 258 of file DALDb2Converter.inc.

handleFunctionConcat ( array  $args)
protected

Handles the CONCAT() function call.

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 219 of file DALDb2Converter.inc.

handleFunctionSeqCurrVal (   $seqName)
protected

Handles the seqCurrVal() function call.

This function should be used to get the next value of a sequence.

Parameters
string$seqNameName of the sequence.
Since
4.0.0
Returns
string

Definition at line 100 of file DALDb2Converter.inc.

handleFunctionSeqNextVal (   $seqName)
protected

Handles the seqNextVal() function call.

This function should be used to get the next value of a sequence.

Parameters
string$seqNameName of the sequence.
Since
4.0.0
Returns
string

Definition at line 82 of file DALDb2Converter.inc.

handleFunctionSequenceExists (   $sequenceName)

Converts sequence exists.

Parameters
(array|string)$sequenceName Name of the sequence.
Since
4.0.0
Returns
string

Definition at line 136 of file DALDb2Converter.inc.

handleFunctionSubstring ( array  $args)
protected

Handles the SUBSTRING() function.

DB2 requires indication of string unit by appending "USING unit".

Parameters
array$argsMethod arguments.
Since
4.0.0
Returns
string

Definition at line 276 of file DALDb2Converter.inc.

handleFunctionTableExists (   $tableName)

Handles table exists.

Parameters
array | string$tableNameTable name argument.
Since
4.0.0
Returns
string

Definition at line 116 of file DALDb2Converter.inc.

handleFunctionToDate ( array  $args)
protected

Handles a custom DAL ToDate() function call.

This function will convert an ISO8601 date into a format suitable for insertion into a query.

Parameters
array$argsThe arguments of the function.
Since
4.0.0
Returns
string

Definition at line 159 of file DALDb2Converter.inc.

Field Documentation

$dataTypes
protected
Initial value:
= array(
'char' => 'CHAR',
'varchar' => 'VARCHAR',
'clob' => 'CLOB',
'blob' => 'BLOB',
'integer' => 'INT',
'smallint' => 'SMALLINT',
'numeric' => 'NUMERIC',
'float' => 'FLOAT',
'real' => 'REAL',
'double_precision' => 'DOUBLE PRECISION',
'boolean' => 'CHAR',
'date' => 'DATE',
'time' => 'TIME',
'timestamp' => 'TIMESTAMP',
'time with time zone' => 'TIME',
)

Definition at line 42 of file DALDb2Converter.inc.


The documentation for this class was generated from the following file: