Zikula 1.0.1
[ class tree: Zikula 1.0.1 ] [ index: Zikula 1.0.1 ] [ all elements ]

Class: ADODB_mssql

Source Location: /includes/classes/adodb/drivers/adodb-mssql.inc.php

Class Overview

ADOConnection
   |
   --ADODB_mssql

Connection object. For connecting to databases, and executing queries.


Variables

Methods


Child classes:

ADODB_mssqlpo
Connection object. For connecting to databases, and executing queries.
ADODB_mssql_n
Connection object. For connecting to databases, and executing queries.

Inherited Variables

Inherited Methods

Class: ADOConnection

ADOConnection::ADOConnection()
Constructor
ADOConnection::addq()
Quotes a string, without prefixing nor appending quotes.
ADOConnection::Affected_Rows()
ADOConnection::AutoExecute()
ADOConnection::BeginTrans()
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().
ADOConnection::BindDate()
ADOConnection::BindTimeStamp()
ADOConnection::BlobDecode()
ADOConnection::BlobEncode()
ADOConnection::CacheExecute()
Execute SQL, caching recordsets.
ADOConnection::CacheFlush()
Flush cached recordsets that match a particular $sql statement.
ADOConnection::CacheGetAll()
ADOConnection::CacheGetArray()
ADOConnection::CacheGetAssoc()
ADOConnection::CacheGetCol()
ADOConnection::CacheGetOne()
ADOConnection::CacheGetRow()
ADOConnection::CachePageExecute()
Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
ADOConnection::CacheSelectLimit()
Will select, getting rows from $offset (1-based), for $nrows.
ADOConnection::Close()
Close Connection
ADOConnection::CommitLock()
ADOConnection::CommitTrans()
If database does not support transactions, always return true as data always commited
ADOConnection::CompleteTrans()
ADOConnection::Concat()
Different SQL databases used different methods to combine strings together.
ADOConnection::Connect()
Connect to database
ADOConnection::CreateSequence()
ADOConnection::DBDate()
Converts a date "d" to a string that the database can understand.
ADOConnection::DBTimeStamp()
Converts a timestamp "ts" to a string that the database can understand.
ADOConnection::Disconnect()
PEAR DB Compat - do not use internally
ADOConnection::DropSequence()
ADOConnection::ErrorMsg()
ADOConnection::ErrorNative()
PEAR DB Compat - do not use internally.
ADOConnection::ErrorNo()
ADOConnection::escape()
ADOConnection::Execute()
Execute SQL
ADOConnection::FailTrans()
ADOConnection::GenID()
Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;
ADOConnection::GetActiveRecords()
ADOConnection::GetActiveRecordsClass()
ADOConnection::GetAll()
ADOConnection::GetArray()
ADOConnection::GetAssoc()
ADOConnection::GetCharSet()
ADOConnection::GetCol()
ADOConnection::GetInsertSQL()
Generates an Insert Query based on an existing recordset.
ADOConnection::GetOne()
Return first element of first row of sql statement. Recordset is disposed for you.
ADOConnection::GetRandRow()
ADOConnection::GetRow()
Return one row of sql statement. Recordset is disposed for you.
ADOConnection::GetUpdateSQL()
Generates an Update Query based on an existing recordset.
ADOConnection::HasFailedTrans()
ADOConnection::IfNull()
ADOConnection::IgnoreErrors()
ADOConnection::InParameter()
ADOConnection::Insert_ID()
ADOConnection::IsConnected()
ADOConnection::LimitQuery()
PEAR DB Compat - do not use internally
ADOConnection::LogSQL()
ADOConnection::MetaColumnNames()
List columns names in a table as an array.
ADOConnection::MetaColumns()
List columns in a database as an array of ADOFieldObjects.
ADOConnection::MetaDatabases()
return the databases that the driver can connect to.
ADOConnection::MetaError()
ADOConnection::MetaErrorMsg()
ADOConnection::MetaForeignKeys()
ADOConnection::MetaIndexes()
List indexes on a table as an array.
ADOConnection::MetaPrimaryKeys()
ADOConnection::MetaTables()
ADOConnection::MetaTransaction()
ADOConnection::MetaType()
ADOConnection::NConnect()
Always force a new connection to database - currently only works with oracle
ADOConnection::nextId()
PEAR DB Compat - do not use internally.
ADOConnection::OffsetDate()
ADOConnection::outp()
All error messages go through this bottleneck function.
ADOConnection::OutParameter()
ADOConnection::PageExecute()
Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
ADOConnection::Param()
ADOConnection::Parameter()
ADOConnection::PConnect()
Establish persistent connect to database
ADOConnection::PO_Insert_ID()
Portable Insert ID. Pablo Roca <pabloroca#mvps.org>
ADOConnection::Prepare()
Should prepare the sql statement and return the stmt resource.
ADOConnection::PrepareSP()
Some databases, eg. mssql require a different function for preparing stored procedures. So we cannot use Prepare().
ADOConnection::q()
ADOConnection::QMagic()
ADOConnection::qstr()
Correctly quotes a string so that all strings are escaped. We prefix and append to the string single-quotes.
ADOConnection::Query()
PEAR DB Compat - do not use internally.
ADOConnection::Quote()
PEAR DB Compat
ADOConnection::Replace()
Insert or replace a single record. Note: this is not the same as MySQL's replace.
ADOConnection::RollbackLock()
ADOConnection::RollbackTrans()
If database does not support transactions, rollbacks always fail, so return false
ADOConnection::RowLock()
Lock a row, will escalate and lock the table if row locking not supported will normally free the lock at the end of the transaction
ADOConnection::SelectDB()
Choose a database to connect to. Many databases do not support this.
ADOConnection::SelectLimit()
Will select, getting rows from $offset (1-based), for $nrows.
ADOConnection::SerializableRS()
Create serializable recordset. Breaks rs link to connection.
ADOConnection::ServerInfo()
ADOConnection::SetCharSet()
ADOConnection::SetDateLocale()
Change the SQL connection locale to a specified locale.
ADOConnection::SetFetchMode()
PEAR DB Compat - do not use internally.
ADOConnection::SetTransactionMode()
ADOConnection::SQLDate()
ADOConnection::StartTrans()
ADOConnection::Time()
ADOConnection::Transpose()
ADOConnection::UnixDate()
Also in ADORecordSet.
ADOConnection::UnixTimeStamp()
Also in ADORecordSet.
ADOConnection::UpdateBlob()
Update a blob column, given a where clause. There are more sophisticated blob handling functions that we could have implemented, but all require a very complex API. Instead we have chosen something that is extremely simple to understand and use.
ADOConnection::UpdateBlobFile()
Usage: UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1');
ADOConnection::UpdateClob()
Usage: UpdateClob('TABLE', 'COLUMN', $var, 'ID=1', 'CLOB');
ADOConnection::UserDate()
Also in ADORecordSet.
ADOConnection::UserTimeStamp()
ADOConnection::Version()
ADOConnection::xCacheFlush()
ADOConnection::_dirFlush()
Private function to erase all of the files and subdirectories in a directory.
ADOConnection::_Execute()
ADOConnection::_findschema()
ADOConnection::_findvers()
ADOConnection::_gencachename()
Private function to generate filename for caching.
ADOConnection::_nconnect()
ADOConnection::_rs2rs()
Convert database recordset to an array recordset input recordset's cursor should be at beginning, and old $rs will be closed.

Class Details

[line 78]
Connection object. For connecting to databases, and executing queries.



[ Top ]


Class Variables

$ansiOuter =  true

[line 105]


Type:   mixed
Overrides:   Array


[ Top ]

$arrayClass =  'ADORecordSet_array_mssql'

[line 101]


Type:   mixed
Overrides:   Array


[ Top ]

$databaseType =  "mssql"

[line 79]


Type:   mixed
Overrides:   Array


[ Top ]

$dataProvider =  "mssql"

[line 80]


Type:   mixed
Overrides:   Array


[ Top ]

$fmtDate =  "'Y-m-d'"

[line 82]


Type:   mixed
Overrides:   Array


[ Top ]

$fmtTimeStamp =  "'Y-m-d H:i:s'"

[line 83]


Type:   mixed
Overrides:   Array


[ Top ]

$hasAffectedRows =  true

[line 87]


Type:   mixed
Overrides:   Array


[ Top ]

$hasGenID =  true

[line 96]


Type:   mixed
Overrides:   Array


[ Top ]

$hasInsertID =  true

[line 84]


Type:   mixed
Overrides:   Array


[ Top ]

$hasTop =  'top'

[line 95]


Type:   mixed
Overrides:   Array


[ Top ]

$identitySQL =  'select SCOPE_IDENTITY()'

[line 107]


Type:   mixed


[ Top ]

$leftOuter =  '*='

[line 103]


Type:   mixed
Overrides:   Array


[ Top ]

$length =  'len'

[line 86]


Type:   mixed
Overrides:   Array


[ Top ]

$maxParameterLen =  4000

[line 100]


Type:   mixed


[ Top ]

$metaColumnsSQL =  "select c.name,t.name,c.length,
   (case when c.xusertype=61 then 0 else c.xprec end),
   (case when c.xusertype=61 then 0 else c.xscale end) 
   from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'"

[line 90]


Type:   mixed


[ Top ]

$metaDatabasesSQL =  "select name from sysdatabases where name <> 'master'"

[line 88]


Type:   mixed
Overrides:   Array


[ Top ]

$metaTablesSQL = "select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE','dtproperties'))"

[line 89]


Type:   mixed
Overrides:   Array


[ Top ]

$poorAffectedRows =  true

[line 106]


Type:   mixed
Overrides:   Array


[ Top ]

$replaceQuote =  "''"

[line 81]


Type:   mixed
Overrides:   Array


[ Top ]

$rightOuter =  '=*'

[line 104]


Type:   mixed
Overrides:   Array


[ Top ]

$substr =  "substring"

[line 85]


Type:   mixed
Overrides:   Array


[ Top ]

$sysDate =  'convert(datetime,convert(char,GetDate(),102),102)'

[line 97]


Type:   mixed
Overrides:   Array


[ Top ]

$sysTimeStamp =  'GetDate()'

[line 98]


Type:   mixed
Overrides:   Array


[ Top ]

$uniqueOrderBy =  true

[line 108]


Type:   mixed
Overrides:   Array


[ Top ]

$uniqueSort =  true

[line 102]


Type:   mixed
Overrides:   Array


[ Top ]

$_bindInputArray =  true

[line 109]


Type:   mixed
Overrides:   Array


[ Top ]

$_dropSeqSQL =  "drop table %s"

[line 167]


Type:   mixed


[ Top ]

$_has_mssql_init =

[line 99]


Type:   mixed


[ Top ]



Class Methods


constructor ADODB_mssql [line 111]

ADODB_mssql ADODB_mssql( )



[ Top ]

method BeginTrans [line 282]

void BeginTrans( )



Overrides ADOConnection::BeginTrans() (Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().)

[ Top ]

method CommitTrans [line 290]

void CommitTrans( [ $ok = true])



Overrides ADOConnection::CommitTrans() (If database does not support transactions, always return true as data always commited)

Parameters:

   $ok  

[ Top ]

method Concat [line 564]

void Concat( )



Overrides ADOConnection::Concat() (Different SQL databases used different methods to combine strings together.)

[ Top ]

method CreateSequence [line 169]

void CreateSequence( [ $seq = 'adodbseq'], [ $start = 1])



Overrides ADOConnection::CreateSequence() (parent method not documented)

Parameters:

   $seq  
   $start  

[ Top ]

method ErrorMsg [line 489]

void ErrorMsg( )



Overrides ADOConnection::ErrorMsg() (parent method not documented)

[ Top ]

method ErrorNo [line 497]

void ErrorNo( )



Overrides ADOConnection::ErrorNo() (parent method not documented)

[ Top ]

method GenID [line 184]

void GenID( [ $seq = 'adodbseq'], [ $start = 1])



Overrides ADOConnection::GenID() (Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;)

Parameters:

   $seq  
   $start  

[ Top ]

method IfNull [line 147]

void IfNull( $field, $ifNull)



Overrides ADOConnection::IfNull() (parent method not documented)

Parameters:

   $field  
   $ifNull  

[ Top ]

method MetaDatabases [line 416]

void MetaDatabases( )



Overrides ADOConnection::MetaDatabases() (return the databases that the driver can connect to.)

[ Top ]

method MetaForeignKeys [line 376]

void MetaForeignKeys( $table, [ $owner = false], [ $upper = false])



Overrides ADOConnection::MetaForeignKeys() (parent method not documented)

Parameters:

   $table  
   $owner  
   $upper  

[ Top ]

method MetaIndexes [line 336]

void &MetaIndexes( $table, [ $primary = false])



Overrides ADOConnection::MetaIndexes() (List indexes on a table as an array.)

Parameters:

   $table  
   $primary  

[ Top ]

method MetaPrimaryKeys [line 439]

void &MetaPrimaryKeys( $table)



Overrides ADOConnection::MetaPrimaryKeys() (parent method not documented)

Parameters:

   $table  

[ Top ]

method MetaTables [line 464]

void &MetaTables( [ $ttype = false], [ $showSchema = false], [ $mask = false])



Overrides ADOConnection::MetaTables() (parent method not documented)

Parameters:

   $ttype  
   $showSchema  
   $mask  

[ Top ]

method Parameter [line 602]

void Parameter( &$stmt, &$var, $name, [ $isOutput = false], [ $maxLen = 4000], [ $type = false])



Overrides ADOConnection::Parameter() (parent method not documented)

Parameters:

   &$stmt  
   &$var  
   $name  
   $isOutput  
   $maxLen  
   $type  

[ Top ]

method Prepare [line 538]

void Prepare( $sql)



Overrides ADOConnection::Prepare() (Should prepare the sql statement and return the stmt resource.)

Parameters:

   $sql  

[ Top ]

method PrepareSP [line 549]

void PrepareSP( $sql)



Overridden in child classes as:

ADODB_mssqlpo::PrepareSP()

Overrides ADOConnection::PrepareSP() (Some databases, eg. mssql require a different function for preparing stored procedures. So we cannot use Prepare().)

Parameters:

   $sql  

[ Top ]

method RollbackTrans [line 298]

void RollbackTrans( )



Overrides ADOConnection::RollbackTrans() (If database does not support transactions, rollbacks always fail, so return false)

[ Top ]

method RowLock [line 329]

void RowLock( $tables, $where, [ $flds = 'top 1 null as ignore'])



Overrides ADOConnection::RowLock() (Lock a row, will escalate and lock the table if row locking not supported will normally free the lock at the end of the transaction)

Parameters:

   $tables  
   $where  
   $flds  

[ Top ]

method SelectDB [line 479]

void SelectDB( $dbName)



Overrides ADOConnection::SelectDB() (Choose a database to connect to. Many databases do not support this.)

Parameters:

   $dbName  

[ Top ]

method SelectLimit [line 208]

void &SelectLimit( $sql, [ $nrows = -1], [ $offset = -1], [ $inputarr = false], [ $secs2cache = 0])



Overrides ADOConnection::SelectLimit() (Will select, getting rows from $offset (1-based), for $nrows.)

Parameters:

   $sql  
   $nrows  
   $offset  
   $inputarr  
   $secs2cache  

[ Top ]

method ServerInfo [line 116]

void ServerInfo( )



Overrides ADOConnection::ServerInfo() (parent method not documented)

[ Top ]

method SetTransactionMode [line 306]

void SetTransactionMode( $transaction_mode)



Overrides ADOConnection::SetTransactionMode() (parent method not documented)

Parameters:

   $transaction_mode  

[ Top ]

method SQLDate [line 222]

void SQLDate( $fmt, [ $col = false])



Overrides ADOConnection::SQLDate() (parent method not documented)

Parameters:

   $fmt  
   $col  

[ Top ]

method UnixDate [line 730]

void UnixDate( $v)



Overrides ADOConnection::UnixDate() (Also in ADORecordSet.)

Parameters:

   $v  

[ Top ]

method UnixTimeStamp [line 735]

void UnixTimeStamp( $v)



Overrides ADOConnection::UnixTimeStamp() (Also in ADORecordSet.)

Parameters:

   $v  

[ Top ]

method UpdateBlob [line 650]

void UpdateBlob( $table, $column, $val, $where, [ $blobtype = 'BLOB'])



Overrides ADOConnection::UpdateBlob() (Update a blob column, given a where clause. There are more sophisticated blob handling functions that we could have implemented, but all require a very complex API. Instead we have chosen something that is extremely simple to understand and use.)

Parameters:

   $table  
   $column  
   $val  
   $where  
   $blobtype  

[ Top ]

method _affectedrows [line 162]

void _affectedrows( )



[ Top ]

method _close [line 721]

void _close( )



[ Top ]

method _connect [line 512]

void _connect( $argHostname, $argUsername, $argPassword, $argDatabasename)



Parameters:

   $argHostname  
   $argUsername  
   $argPassword  
   $argDatabasename  

[ Top ]

method _insertid [line 152]

void _insertid( )



[ Top ]

method _pconnect [line 523]

void _pconnect( $argHostname, $argUsername, $argPassword, $argDatabasename)



Parameters:

   $argHostname  
   $argUsername  
   $argPassword  
   $argDatabasename  

[ Top ]

method _query [line 662]

void _query( $sql, $inputarr)



Overridden in child classes as:

ADODB_mssqlpo::_query()
ADODB_mssql_n::_query()

Parameters:

   $sql  
   $inputarr  

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:40:01 +0200 by phpDocumentor 1.4.1