3
* $Id: Mssql.php 4252 2008-04-19 07:37:53Z jwage $
5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the LGPL. For more information, see
19
* <http://www.phpdoctrine.org>.
23
* Doctrine_Expression_Mssql
26
* @subpackage Expression
27
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28
* @link www.phpdoctrine.org
30
* @version $Revision: 4252 $
31
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
33
class Doctrine_Expression_Mssql extends Doctrine_Expression_Driver
36
* Return string to call a variable with the current timestamp inside an SQL statement
37
* There are three special variables for current date and time:
38
* - CURRENT_TIMESTAMP (date and time, TIMESTAMP type)
39
* - CURRENT_DATE (date, DATE type)
40
* - CURRENT_TIME (time, TIME type)
42
* @return string to call a variable with the current timestamp
45
public function now($type = 'timestamp')
57
* return string to call a function to get a substring inside an SQL statement
59
* @return string to call a function to get a substring
61
public function substring($value, $position, $length = null)
63
if ( ! is_null($length)) {
64
return 'SUBSTRING(' . $value . ', ' . $position . ', ' . $length . ')';
66
return 'SUBSTRING(' . $value . ', ' . $position . ', LEN(' . $value . ') - ' . $position . ' + 1)';
70
* Returns string to concatenate two or more string parameters
74
* @param string $values...
75
* @return string to concatenate two strings
77
public function concat()
79
$args = func_get_args();
80
return '(' . implode(' + ', $args) . ')';
84
* Returns global unique identifier
86
* @return string to get global unique identifier
88
public function guid()
b'\\ No newline at end of file'