/**
* PostgreSQL 8.3 support
*
- * $Id: Postgres83.php,v 1.16 2007/12/12 04:11:10 xzilla Exp $
+ * $Id: Postgres83.php,v 1.17 2007/12/28 17:43:26 ioguix Exp $
*/
include_once('./classes/database/Postgres82.php');
return $this->selectSet($sql);
}
+ // Function methods
+
/**
* Creates a new function.
* @param $funcname The name of the function to create
$sql .= " LANGUAGE \"{$language}\"";
// Add costs
- $sql .= " COST {$cost}";
+ if (!empty($cost))
+ $sql .= " COST {$cost}";
if ($rows <> 0 ){
$sql .= " ROWS {$rows}";
/**
* Manage functions in a database
*
- * $Id: functions.php,v 1.74 2007/12/16 01:14:22 ioguix Exp $
+ * $Id: functions.php,v 1.75 2007/12/28 17:43:25 ioguix Exp $
*/
// Include application functions
function doDrop($confirm) {
global $data, $misc;
global $lang, $_reload_browser;
-
+
if (empty($_REQUEST['function']) && empty($_REQUEST['ma'])) {
doDefault($lang['strspecifyfunctiontodrop']);
exit();
if ($confirm) {
$misc->printTrail('schema');
$misc->printTitle($lang['strdrop'],'pg.function.drop');
-
+
echo "<form action=\"functions.php\" method=\"post\">\n";
-
+
//If multi drop
if (isset($_REQUEST['ma'])) {
foreach($_REQUEST['ma'] as $v) {
}
echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
-
+
echo $misc->form;
// Show cascade drop option if supportd
if ($data->hasDropBehavior()) {
elseif ($fnlang != 'internal' && !$def) doCreate($lang['strfunctionneedsdef'],$szJS);
else {
// Append array symbol to type if chosen
- $status = $data->createFunction($_POST['formFunction'], empty($_POST["nojs"]) ? buildFunctionArguments($_POST) : $_POST["formArguments"],
+ $status = $data->createFunction($_POST['formFunction'], empty($_POST['nojs'])? buildFunctionArguments($_POST) : $_POST['formArguments'],
$_POST['formReturns'] . $_POST['formArray'] , $def , $_POST['formLanguage'],
$_POST['formProperties'], $_POST['formSetOf'] == 'SETOF',
$cost, $rows, false);
* Build out the function arguments string
*/
function buildFunctionArguments($arrayVars) {
- $arrayArgs = array();
- foreach($arrayVars["formArgName"] as $pK => $pV) {
- $arrayArgs[] = $arrayVars["formArgModes"][$pK]." ". trim($pV) ." ". trim($arrayVars["formArgType"][$pK]) . $arrayVars["formArgArray"][$pK];
+ if(isset($_POST['formArgName'])) {
+ $arrayArgs = array();
+ foreach($arrayVars['formArgName'] as $pK => $pV) {
+ $arrayArgs[] = $arrayVars['formArgModes'][$pK].' '. trim($pV) .' '. trim($arrayVars['formArgType'][$pK]) . $arrayVars['formArgArray'][$pK];
+ }
+ return implode(",",$arrayArgs);
}
- return implode(",",$arrayArgs);
+ return '';
}
/**