rendered paste bodyclass 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();
}
}
function execSelectSP() {
$sqe = new StoredProcExecutor();
$param = array(1);
$res = &$sqe->query('sample', $param);
while (($row = $res->fetchRow())) {
echo $row[0] . ' | ' . $row[1] . ' | ' . $row[2] . '<br>';
}
$sqe = null;
}