Database: ezcQueryExpressionPgsql
[ ]
[ Oracle_setup ]
[ ]
[ ]
[ ]
[ ]
Class: ezcQueryExpressionPgsql
|
The ezcQueryExpressionPgsql class is used to create SQL expression for PostgreSQL. [
source]
This class reimplements the methods that have a different syntax in postgreSQL.
Parents
ezcQueryExpression
|
--ezcQueryExpressionPgsql
Inherited Member Variables
From
ezcQueryExpression:
Method Summary
|
public ezcQueryExpressionPgsql |
__construct(
$db )
Constructs an pgsql expression object using the db $db. |
|
public string |
bitXor(
$value1, $value2 )
Returns the SQL that performs the bitwise XOR on two values. |
|
public string |
concat(
$... )
Returns a series of strings concatinated |
|
public string |
dateAdd(
$column, $expr, $type )
Returns the SQL that adds an interval to a timestamp value. |
|
public string |
dateExtract(
$column, $type )
Returns the SQL that extracts parts from a timestamp value. |
|
public string |
dateSub(
$column, $expr, $type )
Returns the SQL that subtracts an interval from a timestamp value. |
|
public string |
md5(
$column )
Returns the md5 sum of the field $column. |
|
public string |
now(
)
Returns the current system date and time. |
|
public string |
position(
$substr, $value )
Returns the SQL to locate the position of the first occurrence of a substring |
|
public string |
subString(
$value, $from, [$len = null] )
Returns part of a string. |
|
public string |
unixTimestamp(
$column )
Returns the SQL that converts a timestamp value to a unix timestamp. |
Inherited Methods
From
ezcQueryExpression :
Methods
__construct
ezcQueryExpressionPgsql __construct(
$db )
Constructs an pgsql expression object using the db $db.
Parameters
| Name |
Type |
Description |
$db |
PDO |
|
Redefinition of
bitXor
string bitXor(
string
$value1, string
$value2 )
Returns the SQL that performs the bitwise XOR on two values.
Parameters
| Name |
Type |
Description |
$value1 |
string |
|
$value2 |
string |
|
Redefinition of
concat
string concat(
string|array(string)
$... )
Returns a series of strings concatinated
concat() accepts an arbitrary number of parameters. Each parameter must contain an expression or an array with expressions.
Parameters
| Name |
Type |
Description |
$... |
string|array(string) |
strings that will be concatinated. |
Throws
| Class | Description |
ezcQueryVariableParameterException |
if no parameters are provided. |
Redefinition of
dateAdd
string dateAdd(
string
$column, numeric
$expr, string
$type )
Returns the SQL that adds an interval to a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$expr |
numeric |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
dateExtract
string dateExtract(
string
$column, string
$type )
Returns the SQL that extracts parts from a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
dateSub
string dateSub(
string
$column, numeric
$expr, string
$type )
Returns the SQL that subtracts an interval from a timestamp value.
Parameters
| Name |
Type |
Description |
$column |
string |
|
$expr |
numeric |
|
$type |
string |
one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR |
Redefinition of
md5
string md5(
string
$column )
Returns the md5 sum of the field $column.
Note: Not SQL92, but common functionality
md5() works with the default PostgreSQL 8 versions.
If you are using PostgreSQL 7.x or older you need to make sure that the digest procedure. If you use RPMS (Redhat and Mandrake) install the postgresql-contrib package. You must then install the procedure by running this shell command:
1. psql [dbname] < /usr/share/pgsql/contrib/pgcrypto.sql
You should make sure you run this as the postgres user.
Parameters
| Name |
Type |
Description |
$column |
string |
|
Redefinition of
now
string now(
)
Returns the current system date and time.
Redefinition of
position
string position(
string
$substr, string
$value )
Returns the SQL to locate the position of the first occurrence of a substring
Parameters
| Name |
Type |
Description |
$substr |
string |
|
$value |
string |
|
Redefinition of
subString
string subString(
string
$value, int
$from, [int
$len = null] )
Returns part of a string.
Note: Not SQL92, but common functionality.
Parameters
| Name |
Type |
Description |
$value |
string |
the target $value the string or the string column. |
$from |
int |
extract from this characeter. |
$len |
int |
extract this amount of characters. |
Redefinition of
unixTimestamp
string unixTimestamp(
string
$column )
Returns the SQL that converts a timestamp value to a unix timestamp.
Parameters
| Name |
Type |
Description |
$column |
string |
|
Redefinition of
Last updated: Thu, 01 Nov 2007