Class QSqlServerDatabase
Database Adapter for Microsoft SQL Server Utilizes the Microsoft SQL Server extension php_mssql.dll (win) or the freetds extension (*nix)
NOTES:
LimitInfo and Query utilizes an interal SQL tag QCUBED_OFFSET<#>, where # represents the number of rows to offset for "Limit"-based queries. The QCUBED_OFFSET is added internally by SqlLimitVariablePrefix(), and it is handled (and removed from the query) by Query(). In error messages and DB profiling, the QCUBED_OFFSET<#> tag WILL appear (if applicable). The framework will handle this gracefully, but obviously, if you try and cut and paste SQL code that contains QCUBED_OFFSET<#> into QueryAnalyzer, the query will fail, so just be aware of that. If you want to do something like test queries with QueryAnalyzer, just remember to manually remove any QCUBED_OFFSET<#> information.
MSSQL will return DATE values according to regional settings. QCubed expects dates to be of the format YYYY-MM-DD. Therefore, make sure that your PHP.INI file says: mssql.datetimeconvert = Off
Also, if you are using MSSQL Server 2K from Linux/Unix (using FreeTDS), you may encounter an issue with the following error: WARNING! ! Some character(s) could not be converted into client's character set... If so, then update your connection settings in the freetds.conf to say the following: client charset = UTF-8 For consistancy, you will also want to update QApplication::$EncodingType to be UTF-8 as well.
- QBaseClass
- QDatabaseBase
- QSqlServerDatabase
public
string
|
#
SqlVariable( mixed $mixData, boolean $blnIncludeEquality = false, boolean $blnReverseEquality = false )
Properly escapes $mixData to be used as a SQL query parameter. If IncludeEquality is set (usually not), then include an equality operator. So for most data, it would just be "=". But, for example, if $mixData is NULL, then most RDBMS's require the use of "IS". |
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
|
protected
mixed
|
#
ExecuteQuery( string $strQuery )
Sends a SQL query for execution to the database In this regard, a query is a 'SELECT' statement |
protected
mixed
|
#
ExecuteNonQuery( string $strNonQuery )
Sends a non-SELECT query (such as INSERT, UPDATE, DELETE, TRUNCATE) to DB server. In most cases, the results of this function are not used and you should not send 'SELECT' queries using this method because a result is not guaranteed to be returned |
public
mixed|string[]
|
|
public
|
|
public
mixed
|
|
public
mixed
|
|
public
mixed
|
|
protected
|
#
ExecuteTransactionBegin( )
This function actually begins the database transaction. Must be implemented in all subclasses. The "TransactionBegin" wrapper are meant to be called by end-user code |
protected
|
#
ExecuteTransactionCommit( )
This function actually commits the database transaction. Must be implemented in all subclasses. The "TransactionCommit" wrapper are meant to be called by end-user code |
protected
|
#
ExecuteTransactionRollBack( )
This function actually rolls back the database transaction. Must be implemented in all subclasses. The "TransactionRollBack" wrapper are meant to be called by end-user code |
public
mixed
|
|
public
mixed
|
OverrideAttributes(),
__call()
|
Adapter
|
protected
|
$objMsSql
|
|
protected
string
|
$strEscapeIdentifierBegin
The beginning part of characters which can escape identifiers in a SQL query for the database |
#
'['
|
protected
string
|
$strEscapeIdentifierEnd
The ending part of characters which can escape identifiers in a SQL query for the database |
#
']'
|
protected
boolean
|
$blnOnlyFullGroupBy
|
#
true
|
$blnConnectedFlag,
$blnEnableProfiling,
$intDatabaseIndex,
$intTransactionDepth,
$objCacheProviderStack,
$objConfigArray,
$strProfileArray
|
$Adapter,
$AffectedRows,
$Caching,
$Database,
$DatabaseIndex,
$DateFormat,
$EnableProfiling,
$EscapeIdentifierBegin,
$EscapeIdentifierEnd,
$Host,
$OnlyFullGroupBy,
$Password,
$Port,
$Profile,
$Protocol,
$Server,
$Service,
$Username
|