Пример #1
0
 /**
  * Executes a prepared statement
  *
  * @param array $inputParams
  * @return bool
  */
 public function execute($inputParams = null)
 {
     $mode = OCI_COMMIT_ON_SUCCESS;
     if ($this->_pdoOci8->isTransaction()) {
         $mode = OCI_DEFAULT;
     }
     // Set up bound parameters, if passed in
     if (is_array($inputParams)) {
         foreach ($inputParams as $key => $value) {
             $this->bindParam($key, $value);
         }
     }
     return oci_execute($this->_sth, $mode);
 }
Пример #2
0
 /**
  * Executes a prepared statement
  *
  * @param array $inputParams
  * @return bool
  */
 public function execute($inputParams = null)
 {
     $mode = OCI_COMMIT_ON_SUCCESS;
     if ($this->_pdoOci8->isTransaction()) {
         $mode = OCI_DEFAULT;
     }
     // Set up bound parameters, if passed in
     if (is_array($inputParams)) {
         foreach ($inputParams as $key => $value) {
             $this->bindParam($key, $inputParams[$key]);
         }
     }
     $result = @oci_execute($this->_sth, $mode);
     if ($result != true) {
         $oci_error = ocierror($this->_sth);
         throw new \CrazyCodr\Pdo\Oci8\Exceptions\SqlException($oci_error['message'], $oci_error['code']);
     }
     return $result;
 }
Пример #3
0
 /**
  * Tests rolling back a transaction
  */
 public function testRollBack()
 {
     $this->_object->beginTransaction();
     $this->assertTrue($this->_object->rollBack());
     $this->assertFalse($this->_object->isTransaction());
 }