Database: ezcQuerySelectOracle
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcQuerySelectOracle
|
Oracle specific implementation of ezcQuery. [
source]
This class reimplements methods where Oracle differs from the standard implementation in ezcQuery.Most notably LIMIT which is not supported directly in oracle.
Parents
ezcQuery
|
--ezcQuerySelect
|
--ezcQuerySelectOracle
Inherited Constants
From
ezcQuerySelect:
Inherited Member Variables
From
ezcQuerySelect:
From
ezcQuery:
Method Summary
|
public ezcQuerySelectOracle |
__construct(
$db )
Constructs a new ezcQueryOracle object. |
|
public string |
alias(
$name, $alias )
Returns SQL to create an alias. |
|
public static string |
getDummyTableName(
)
Returns dummy table name 'dual'. |
|
public void |
getQuery(
)
Transforms the query from the parent to provide LIMIT functionality. |
|
public string |
limit(
$limit, [$offset = 0] )
Returns SQL that limits the result set. |
|
public void |
reset(
)
Resets the query object for reuse. |
Inherited Methods
From
ezcQuerySelect :
From
ezcQuery :
Methods
__construct
ezcQuerySelectOracle __construct(
$db )
Constructs a new ezcQueryOracle object.
Parameters
| Name |
Type |
Description |
$db |
PDO |
|
Redefinition of
alias
string alias(
$name,
$alias )
Returns SQL to create an alias.
This method can be used to create an alias for either a table or a column. Example:
1. // this will make the table users have the alias employees
2. // and the column user_id the alias employee_id
3. $q->select( $q->aliAs( 'user_id', 'employee_id' )
4. ->from( $q->aliAs( 'users', 'employees' ) );
Parameters
| Name |
Type |
Description |
$name |
|
|
$alias |
|
|
Redefinition of
getDummyTableName
string getDummyTableName(
)
Returns dummy table name 'dual'.
Redefinition of
getQuery
void getQuery(
)
Transforms the query from the parent to provide LIMIT functionality.
Redefinition of
limit
string limit(
mixed
$limit, [mixed
$offset = 0] )
Returns SQL that limits the result set.
$limit controls the maximum number of rows that will be returned. $offset controls which row that will be the first in the result set from the total amount of matching rows.
Oracle does not support the LIMIT keyword. A complete rewrite of the query is neccessary. Queries will be rewritten like this:
1. Original query in MySQL syntax:
2. SELECT * FROM table LIMIT 10, 5
3. The corresponding Oracle query:
4. SELECT * FROM (SELECT a.*, ROWNUM rn FROM (SELECT * FROM table) a WHERE rownum <= 15) WHERE rn >= 6;
Even though the Oracle query is three times as long it performs about the same as mysql on small result sets and a bit better on large result sets.
Note that you will not get a result if you call buildLimit() when using the oracle database.
Redefinition of
reset
void reset(
)
Resets the query object for reuse.
Redefinition of
Last updated: Fri, 02 Nov 2007