ePages 6.10 - DE_EPAGES/ShopTransfer/API/DBISybase.pm

Package DE_EPAGES::ShopTransfer::API::DBISybase

Functions

getColumnPosition
getColumns
getDBName
getGeneralizeDateTimeStatement
getMasterOfReference
getReferences
getTypesOfColumns
getUniqueIndexes
isColumnAutoIncrement
reserveIdentifier

getColumnPosition

Returns the position of the column (start with 0). Returns undef if column does not exist.

Syntax
$Position = $dbi->getColumnPosition($Table, $Column);
Input
$Table (string)
table name
$Column (string)
column name
Return
$Position (integer)
position of column

getColumns

Returns all columns.

Syntax
@Columns = $dbi->getColumns($Table);
Input
$Table (string)
table name
Return
@Columns (array.string)
column names

getDBName

returns the current db name.

Syntax
$DbName = getDBName();
Return
$DbName (string)
name of current database

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
$Column (string)
column name
$TablePrefix (string)
prefix, which should be inserted before the column name
Return
$statement (string)
the new column statement

getMasterOfReference

Returns the master of foreign key. Returns undef unless there is no reference.

Syntax
($MasterTable, $MasterColumn) = $dbi->getMasterOfReference($Table, $Column);
Input
$Table (string)
slave table name
$Column (string)
slave column name
$MasterTable (string)
master table name
$MasterColumn (string)
master column name

getReferences

Returns the reference info of a table.

Syntax
$ahReferences = getReferences($Table);
Input
$Table (string)
table name
Return
$ahReferences (ref.array.hash.string)
references: keys are Name,ForeignKeyTable,ForeignKeyColumn,PrimaryKeyTable,PrimaryKeyColumn

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
$Table (string)
table name
Return
$hTypes (ref.hash.string)
column types key: columnname value: type

getUniqueIndexes

Returns first columns of all unique indexes.

Syntax
@Columns = $dbi->getUniqueIndexes($Table);
Input
$Table (string)
table name
Return
@Columns (array.string)
column names

isColumnAutoIncrement

Returns 1 if the table has an auto increment column or an _nextid table

Syntax
$isAutoInc = $dbi->isColumnAutoIncrement();
Input
$Table (string)
table name
Return
$Parameter (int)
binary value

reserveIdentifier

Updates the _nextid table, to define a gap for bcp input.

Syntax
$FirstNextID = $dbi->reserveIdentifier($Table, $CountOfRows);
Input
$Table (string)
table name
$CountOfRows (integer)
requested row count
Return
$FirstNextID (integer)
first free identifier