diff options
author | Timothy Warren <tim@timshomepage.net> | 2011-09-23 16:28:13 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2011-09-23 16:28:13 +0200 |
commit | 4d292bdb56ba6afc26878d9bcd82892f48d9f1a4 (patch) | |
tree | a894323d2e896adcb7d25d7d1edb806295147384 /system/database/drivers/oci8 | |
parent | 5fc36d8c9dc0bd5d41ed7dea36f999c6e07e1615 (diff) | |
parent | d26133be24eef68b1bead61e7e808f4424a71a0a (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r-- | system/database/drivers/oci8/oci8_driver.php | 36 | ||||
-rw-r--r-- | system/database/drivers/oci8/oci8_result.php | 17 |
2 files changed, 42 insertions, 11 deletions
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index d4adfd528..1cf063ec1 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -79,7 +79,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function db_connect() { - return @ocilogon($this->username, $this->password, $this->hostname); + return @ocilogon($this->username, $this->password, $this->hostname, $this->char_set); } // -------------------------------------------------------------------- @@ -92,7 +92,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function db_pconnect() { - return @ociplogon($this->username, $this->password, $this->hostname); + return @ociplogon($this->username, $this->password, $this->hostname, $this->char_set); } // -------------------------------------------------------------------- @@ -136,7 +136,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function db_set_charset($charset, $collation) { - // @todo - add support if needed + // this is done upon connect return TRUE; } @@ -643,6 +643,34 @@ class CI_DB_oci8_driver extends CI_DB { // -------------------------------------------------------------------- /** + * Insert_batch statement + * + * Generates a platform-specific insert string from the supplied data + * + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + function _insert_batch($table, $keys, $values) + { + $keys = implode(', ', $keys); + $sql = "INSERT ALL\n"; + + for ($i = 0, $c = count($values); $i < $c; $i++) + { + $sql .= ' INTO ' . $table . ' (' . $keys . ') VALUES ' . $values[$i] . "\n"; + } + + $sql .= 'SELECT * FROM dual'; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** * Update statement * * Generates a platform-specific update string from the supplied data @@ -776,4 +804,4 @@ class CI_DB_oci8_driver extends CI_DB { /* End of file oci8_driver.php */ -/* Location: ./system/database/drivers/oci8/oci8_driver.php */
\ No newline at end of file +/* Location: ./system/database/drivers/oci8/oci8_driver.php */ diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 88531b436..2713f6f12 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -42,15 +42,18 @@ class CI_DB_oci8_result extends CI_DB_result { */ function num_rows() { - $rowcount = count($this->result_array()); - @ociexecute($this->stmt_id); - - if ($this->curs_id) + if ($this->num_rows === 0 && count($this->result_array()) > 0) { - @ociexecute($this->curs_id); + $this->num_rows = count($this->result_array()); + @ociexecute($this->stmt_id); + + if ($this->curs_id) + { + @ociexecute($this->curs_id); + } } - return $rowcount; + return $this->num_rows; } // -------------------------------------------------------------------- @@ -246,4 +249,4 @@ class CI_DB_oci8_result extends CI_DB_result { /* End of file oci8_result.php */ -/* Location: ./system/database/drivers/oci8/oci8_result.php */
\ No newline at end of file +/* Location: ./system/database/drivers/oci8/oci8_result.php */ |