cvs: pear /MDB2/tests MDB2_nonstandard_pgsql.php

From: Date: Sun, 04 Mar 2007 21:36:09 +0000
Subject: cvs: pear /MDB2/tests MDB2_nonstandard_pgsql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44957@lists.php.net to get a copy of this message
quipo Sun Mar 4 21:36:09 2007 UTC Modified files: /pear/MDB2/tests MDB2_nonstandard_pgsql.php Log: added createFunction() and dropFunction() http://cvs.php.net/viewvc.cgi/pear/MDB2/tests/MDB2_nonstandard_pgsql.php?r1=1.4&r2=1.5&diff_format=u Index: pear/MDB2/tests/MDB2_nonstandard_pgsql.php diff -u pear/MDB2/tests/MDB2_nonstandard_pgsql.php:1.4 pear/MDB2/tests/MDB2_nonstandard_pgsql.php:1.5 --- pear/MDB2/tests/MDB2_nonstandard_pgsql.php:1.4 Sat Dec 9 21:58:23 2006 +++ pear/MDB2/tests/MDB2_nonstandard_pgsql.php Sun Mar 4 21:36:08 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 2006 Lorenzo Alberton | +// | Copyright (c) 2006-2007 Lorenzo Alberton | // | All rights reserved. | // +----------------------------------------------------------------------+ // | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB | @@ -41,7 +41,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: MDB2_nonstandard_pgsql.php,v 1.4 2006/12/09 21:58:23 quipo Exp $ +// $Id: MDB2_nonstandard_pgsql.php,v 1.5 2007/03/04 21:36:08 quipo Exp $ class MDB2_nonstandard_pgsql extends MDB2_nonstandard { @@ -76,6 +76,19 @@ function dropTrigger($trigger_name, $table_name) { return $this->db->exec('DROP TRIGGER '.$trigger_name .' ON '. $table_name); } + + function createFunction($name) { + $query = "CREATE FUNCTION $name (Decimal(6,2), Decimal(6,2)) RETURNS Decimal(6,2) +AS 'select $1 + $2;' +LANGUAGE SQL +IMMUTABLE +RETURNS NULL ON NULL INPUT"; + return $this->db->exec($query); + } + + function dropFunction($name) { + return $this->db->exec('DROP FUNCTION '.$name.' (Decimal(6,2), Decimal(6,2))'); + } } ?> \ No newline at end of file

« previous php.pear.cvs (#44957) next »