/**
  * @covers Zend\Db\Adapter\Driver\Oci8\Statement::prepare
  * @covers Zend\Db\Adapter\Driver\Oci8\Statement::isPrepared
  */
 public function testPrepare()
 {
     $ociResource = oci_connect($this->variables['username'], $this->variables['password']);
     $statement = new Statement();
     $statement->initialize($ociResource);
     $this->assertFalse($statement->isPrepared());
     $this->assertSame($statement, $statement->prepare('SELECT * FROM DUAL'));
     $this->assertTrue($statement->isPrepared());
     unset($resource, $ociResource);
 }
예제 #2
0
 /**
  * @param Statement $statement
  * @return null|int
  */
 public function getCountForStatement(Statement $statement)
 {
     $countStmt = clone $statement;
     $sql = $statement->getSql();
     if ($sql == '' || stripos(strtolower($sql), 'select') === false) {
         return;
     }
     $countSql = 'SELECT COUNT(*) as "count" FROM (' . $sql . ')';
     $countStmt->prepare($countSql);
     $result = $countStmt->execute();
     $countRow = $result->current();
     return $countRow['count'];
 }
예제 #3
0
파일: Oci8.php 프로젝트: eltondias/Relogio
 /**
  * Register statement prototype
  *
  * @param Statement $statementPrototype
  * @return Oci8
  */
 public function registerStatementPrototype(Statement $statementPrototype)
 {
     $this->statementPrototype = $statementPrototype;
     $this->statementPrototype->setDriver($this);
     // needs access to driver to createResult()
     return $this;
 }
예제 #4
0
 /**
  * @covers Zend\Db\Adapter\Driver\Oci8\Statement::getParameterContainer
  * @todo   Implement testGetParameterContainer().
  */
 public function testGetParameterContainer()
 {
     $container = new ParameterContainer();
     $this->statement->setParameterContainer($container);
     $this->assertSame($container, $this->statement->getParameterContainer());
 }