コード例 #1
0
ファイル: Statement.php プロジェクト: winkbrace/oracle
 /**
  * @return bool
  */
 public function isExecuted()
 {
     if (empty($this->executor)) {
         return false;
     }
     return $this->executor->isExecuted();
 }
コード例 #2
0
ファイル: ExecutorTest.php プロジェクト: winkbrace/oracle
 public function testInsertMultiple()
 {
     $data = array(array('foo', '01-01-2014'), array('bar', '02-01-2014'), array('baz', '03-01-2014'));
     $sql = "insert into test (value, create_date) values (:val, to_date(:cd, 'dd-mm-yyyy'))";
     $connection = new Connection('test');
     $statement = new Statement($sql, $connection);
     $executor = new Executor($statement);
     $binds = array(':val', ':cd');
     $sizes = array(10, 10);
     $errors = $executor->executeMultiple($binds, $sizes, $data, Executor::NO_COMMIT);
     $this->assertSame(0, $errors);
     // validate that we now have 3 extra records
     $statement = new Statement("select count(*) from test", $connection);
     $fetcher = new \Oracle\Query\Fetcher($statement);
     $count = $fetcher->fetchFirstValue();
     $this->assertEquals(7, $count);
     $executor->rollback();
 }