Source for file adodb-netezza.inc.php
Documentation is available at adodb-netezza.inc.php
V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.
First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
Based on the previous postgres drivers.
MetaDatabasesSQL, MetaTablesSQL, MetaColumnsSQL
Note: You have to have admin privileges to access the system tables
Removed non-working keys code (Netezza has no concept of keys)
Fixed the way data types and lengths are returned in MetaColumns()
as well as added the default lengths for certain types
Updated public variables for Netezza
Still need to remove blob functions, as Netezza doesn't suppport blob
include_once(ADODB_DIR. '/drivers/adodb-postgres64.inc.php');
var $metaDatabasesSQL = "select objname from _v_object_data where objtype='database' order by 1";
var $metaTablesSQL = "select objname from _v_object_data where objtype='table' order by 1";
var $isoDates = true; // accepts dates in ISO format
var $metaColumnsSQL = "SELECT attname, atttype FROM _v_relation_column_def WHERE name = '%s' AND attnum > 0 ORDER BY attnum";
var $metaColumnsSQL1 = "SELECT attname, atttype FROM _v_relation_column_def WHERE name = '%s' AND attnum > 0 ORDER BY attnum";
// netezza doesn't have keys. it does have distributions, so maybe this is
// something that can be pulled from the system tables
var $true = 't'; // string that represents TRUE for a database
var $false = 'f'; // string that represents FALSE for a database
var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
var $autoRollback = true; // apparently pgsql does not autorollback properly before 4.3.4
// http://bugs.php.net/bug.php?id=25404
// Changed this function to support Netezza which has no concept of keys
// could posisbly work on other things from the system table later.
global $ADODB_FETCH_MODE;
$save = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = $save;
$fld->name = $rs->fields[0];
// since we're returning type and length as one string,
if ($first = strstr($rs->fields[1], "(")) {
$fld->max_length = trim($first, "()");
if ($first = strpos($rs->fields[1], "(")) {
$fld->type = substr($rs->fields[1], 0, $first);
$fld->type = $rs->fields[1];
case "time with time zone":
else $retarr[($upper) ? strtoupper($fld->name) : $fld->name] = $fld;
/*--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------*/
global $ADODB_FETCH_MODE;
$mode = $ADODB_FETCH_MODE;
default: $this->fetchMode = PGSQL_BOTH; break;
$this->adodbFetchMode = $mode;
// _initrs modified to disable blob handling
|