Package DE_EPAGES::ShopTransfer::API::DBI
Functions
- GetIDByPath
- IsColumnObjectID
- dynamicIDTables
- getAliasByID
- getColumnPosition
- getColumns
- getDBName
- getGeneralizeDateTimeStatement
- getMasterColumn
- getMasterOfReference
- getObjectColumn
- getPKeyOfTable
- getReferenceColumns
- getReferences
- getTables
- getTypesOfColumns
- getUniqueIndexes
- isColumnAutoIncrement
- quoteParameter
GetIDByPath
Returns the identifier of an object without loading objects.
Syntax |
$ObjectID = $dbi->getIDByPath(@Path); |
Example |
$ShopID = $dbi->getIDByPath('Shops',$ShopAlias); |
Input |
|
Return |
|
IsColumnObjectID
Returns true the columns is a object identifier.
Syntax |
$IsObjectColumn = $dbi->isColumnObjectID($Table, $Column); |
Input |
|
Return |
|
dynamicIDTables
Returns tables, which have only one primary key, no foreign key on it and no _nextid table/autoincrement.
Syntax |
$aTables = $dbi->dynamicIDTables(); |
Return |
|
getAliasByID
Returns the alias of an object without loading objects. Returns undef if the object does not exist.
Syntax |
$Alias = $dbi->getAliasByID( $ObjectID ); |
Input |
|
Return |
|
getColumnPosition
Returns the position of the column (start with 0). Returns undef if column does not exist.
Syntax |
$Position = $dbi->getColumnPosition($Table, $Column); |
Input |
|
Return |
|
getColumns
Returns all columns.
Syntax |
@Columns = $dbi->getColumns($Table); |
Input |
|
Return |
|
getDBName
returns the current db name.
Syntax |
$DbName = getDBName(); |
Return |
|
getGeneralizeDateTimeStatement
Returns a statement for querying datetime columns in a generalized format. Instead of returning the plain column name, a convert statement like 'convert(char(19), $TablePrefix$Column, 117)' is returned and can be integrated into a 'SELECT $statement from table where bla' query.
Syntax |
$statement = $dbi->getGeneralizeDateTimeStatement($Column); |
Input |
|
Return |
|
getMasterColumn
Returns the masterMaster of a foreign key chain. Returns undef unless there is no reference.
Syntax |
($MasterTable, $MasterColumn) = $dbi->getMasterColumn($Table, $Column); |
Input |
|
Return |
|
getMasterOfReference
Returns the master of foreign key. Returns undef unless there is no reference.
Syntax |
($MasterTable, $MasterColumn) = $dbi->getMasterOfReference($Table, $Column); |
Input |
|
getObjectColumn
Returns the column which can be used for siteid assignment.
Syntax |
$Column = $dbi->getObjectColumn($Table); |
Input |
|
Return |
|
getPKeyOfTable
Returns the primary key of a table.
Syntax |
@PrimaryKeyColumns = $dbi->getPKeyOfTable($Table); $PrimaryKeyColumn = $dbi->getPKeyOfTable($Table); |
Input |
|
Return |
|
getReferenceColumns
Returns the columns of a table, which have foreign keys.
Syntax |
@Columns = $dbi->getReferenceColumns($Table); |
Input |
|
Return |
|
getReferences
Returns the reference info of a table.
Syntax |
$ahReferences = getReferences($Table); |
Input |
|
Return |
|
getTables
Returns list of table names, in correct order of delete.
Syntax |
$aTables = $dbi->getTables(); |
Return |
|
getTypesOfColumns
Returns types of columns. Currently used types: bit,char,datetime,float, int,money,nchar,numeric,nvarchar,text,tinyint,varchar
Syntax |
$hTypes= $dbi->getTypesOfColumns($Table); |
Input |
|
Return |
|
getUniqueIndexes
Returns first columns of all unique indexes.
Syntax |
@Columns = $dbi->getUniqueIndexes($Table); |
Input |
|
Return |
|
isColumnAutoIncrement
Returns 1 if the table has an auto increment column or an _nextid table
Syntax |
$isAutoInc = $dbi->isColumnAutoIncrement(); |
Input |
|
Return |
|
quoteParameter
Tests and quotes the parameters according to the data type spefification.
Syntax |
$Parameter = $dbi->quoteParameter($Type, $Value); |
Example |
$Parameter = $dbi->quoteParameter('String', "don't"); |
Input |
|
Return |
|