/** * @param array $binds * @throws OracleException */ public function bind(array $binds) { try { $this->binder->bind($binds); } catch (\Exception $e) { throw new OracleException($this->getError($e->getMessage())); } }
public function testFetchFirstValueAfterNumRowsWithBinds() { $statement = new Statement("select * from test where id in (:one, :two) order by id", new Connection('test')); $binder = new Binder($statement); $binder->bind(array(':one' => 1, ':two' => 2)); $fetcher = new Fetcher($statement); $fetcher->getNumRows(); $value = $fetcher->fetchFirstValue('VALUE'); $this->assertEquals('hello, world', $value); }
public function testGetNumRowsWithBinds() { $statement = new Statement("select * from test where id in (:foo, :bar)", new Connection('test')); $binder = new \Oracle\Query\Binder($statement); $binder->bind(array(':foo' => 2, ':bar' => 4)); $fetcher = new Fetcher($statement); $this->assertEquals(2, $fetcher->getNumRows()); }