Exemple #1
0
 /**
  * simple subselect emulation: leaves the query untouched for all RDBMS
  * that support subselects
  *
  * @param   string  the SQL query for the subselect that may only
  *                      return a column
  * @param   string  determines type of the field
  *
  * @return  string  the query
  */
 public function subSelect($query, $type = false)
 {
     if ($this->supports('sub_selects') === true) {
         return $query;
     }
     if (!$this->supports('sub_selects')) {
         return MDB2_Driver_Common::raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'method not implemented', __FUNCTION__);
     }
     $col = $this->queryCol($query, $type);
     if (MDB2::isError($col)) {
         return $col;
     }
     if (!is_array($col) || count($col) == 0) {
         return 'NULL';
     }
     if ($type) {
         $this->loadModule('Datatype', null, true);
         return $this->datatype->implodeArray($col, $type);
     }
     return implode(', ', $col);
 }