class StoredProcExecutor extends Executor { private $rs_; public function & query($name, $params = null) { $this->mdb2_->loadModule('Function'); $this->rs_ = &$this->mdb2_->executeStoredProc($name, $params); if (PEAR::isError($this->rs_)) { throw new Exception($this->rs_->getMessage(), $this->rs_->getCode()); } return $this->rs_; } public function __destruct() { if ($this->rs_ != null) $this->rs_->free(); } }