blob: 362da58fb53a21ec6a72ee967072ffcbc2b8f9d6 [file] [log] [blame]
Derek Jones0b59f272008-05-13 04:22:33 +00001<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Derek Allardd2df9bc2007-04-15 17:41:17 +00002/**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
Derek Allard3d879d52008-01-18 19:41:32 +00007 * @package CodeIgniter
8 * @author ExpressionEngine Dev Team
Rick Ellis37b3ecf2008-09-12 23:34:18 +00009 * @copyright Copyright (c) 2008, EllisLab, Inc.
Derek Jones7a9193a2008-01-21 18:39:20 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
Derek Allard3d879d52008-01-18 19:41:32 +000012 * @since Version 1.0
Derek Allardd2df9bc2007-04-15 17:41:17 +000013 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
19 * oci8 Database Adapter Class
20 *
21 * Note: _DB is an extender class that the app controller
22 * creates dynamically based on whether the active record
23 * class is being used or not.
24 *
Derek Allard3d879d52008-01-18 19:41:32 +000025 * @package CodeIgniter
Derek Allardd2df9bc2007-04-15 17:41:17 +000026 * @subpackage Drivers
27 * @category Database
Derek Allard3d879d52008-01-18 19:41:32 +000028 * @author ExpressionEngine Dev Team
Derek Jones7a9193a2008-01-21 18:39:20 +000029 * @link http://codeigniter.com/user_guide/database/
Derek Allardd2df9bc2007-04-15 17:41:17 +000030 */
31
32/**
33 * oci8 Database Adapter Class
34 *
35 * This is a modification of the DB_driver class to
36 * permit access to oracle databases
37 *
38 * NOTE: this uses the PHP 4 oci methods
39 *
40 * @author Kelly McArdle
41 *
42 */
43
44class CI_DB_oci8_driver extends CI_DB {
45
Derek Allard694b5b82007-12-18 15:58:03 +000046 /**
47 * The syntax to count rows is slightly different across different
48 * database engines, so this string appears in each driver and is
49 * used for the count_all() and count_all_results() functions.
50 */
Derek Allard39b622d2008-01-16 21:10:09 +000051 var $_count_string = "SELECT COUNT(1) AS ";
52 var $_random_keyword = ' ASC'; // not currently supported
Derek Allard694b5b82007-12-18 15:58:03 +000053
Derek Allardd2df9bc2007-04-15 17:41:17 +000054 // Set "auto commit" by default
55 var $_commit = OCI_COMMIT_ON_SUCCESS;
56
57 // need to track statement id and cursor id
58 var $stmt_id;
59 var $curs_id;
60
61 // if we use a limit, we will add a field that will
62 // throw off num_fields later
63 var $limit_used;
64
65 /**
66 * Non-persistent database connection
67 *
68 * @access private called by the base class
69 * @return resource
70 */
71 function db_connect()
72 {
73 return @ocilogon($this->username, $this->password, $this->hostname);
74 }
75
76 // --------------------------------------------------------------------
77
78 /**
79 * Persistent database connection
80 *
81 * @access private called by the base class
82 * @return resource
83 */
84 function db_pconnect()
85 {
86 return @ociplogon($this->username, $this->password, $this->hostname);
87 }
88
89 // --------------------------------------------------------------------
90
91 /**
92 * Select the database
93 *
94 * @access private called by the base class
95 * @return resource
96 */
97 function db_select()
98 {
99 return TRUE;
100 }
101
102 // --------------------------------------------------------------------
103
104 /**
Derek Allard39b622d2008-01-16 21:10:09 +0000105 * Set client character set
106 *
107 * @access public
108 * @param string
109 * @param string
110 * @return resource
111 */
112 function db_set_charset($charset, $collation)
113 {
Rick Ellisff734012008-09-30 20:38:12 +0000114 // @todo - add support if needed
Derek Allard39b622d2008-01-16 21:10:09 +0000115 return TRUE;
116 }
117
118 // --------------------------------------------------------------------
119
120 /**
Derek Allardd2df9bc2007-04-15 17:41:17 +0000121 * Version number query string
122 *
123 * @access public
124 * @return string
125 */
126 function _version()
127 {
128 return ociserverversion($this->conn_id);
129 }
130
131 // --------------------------------------------------------------------
132
133 /**
134 * Execute the query
135 *
136 * @access private called by the base class
137 * @param string an SQL query
138 * @return resource
139 */
140 function _execute($sql)
141 {
142 // oracle must parse the query before it is run. All of the actions with
143 // the query are based on the statement id returned by ociparse
Rick Ellis482ee432008-10-07 00:59:08 +0000144 $this->stmt_id = FALSE;
Derek Allardd2df9bc2007-04-15 17:41:17 +0000145 $this->_set_stmt_id($sql);
146 ocisetprefetch($this->stmt_id, 1000);
147 return @ociexecute($this->stmt_id, $this->_commit);
148 }
149
150 /**
151 * Generate a statement ID
152 *
153 * @access private
154 * @param string an SQL query
155 * @return none
156 */
157 function _set_stmt_id($sql)
158 {
Derek Jones0b59f272008-05-13 04:22:33 +0000159 if ( ! is_resource($this->stmt_id))
Derek Allardd2df9bc2007-04-15 17:41:17 +0000160 {
161 $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql));
162 }
163 }
164
165 // --------------------------------------------------------------------
166
167 /**
168 * Prep the query
169 *
170 * If needed, each database adapter can prep the query string
171 *
172 * @access private called by execute()
173 * @param string an SQL query
174 * @return string
175 */
176 function _prep_query($sql)
177 {
178 return $sql;
179 }
180
181 // --------------------------------------------------------------------
182
183 /**
184 * getCursor. Returns a cursor from the datbase
185 *
186 * @access public
187 * @return cursor id
188 */
189 function get_cursor()
190 {
191 $this->curs_id = ocinewcursor($this->conn_id);
192 return $this->curs_id;
193 }
194
195 // --------------------------------------------------------------------
196
197 /**
198 * Stored Procedure. Executes a stored procedure
199 *
200 * @access public
201 * @param package package stored procedure is in
202 * @param procedure stored procedure to execute
203 * @param params array of parameters
204 * @return array
205 *
206 * params array keys
207 *
208 * KEY OPTIONAL NOTES
209 * name no the name of the parameter should be in :<param_name> format
210 * value no the value of the parameter. If this is an OUT or IN OUT parameter,
211 * this should be a reference to a variable
212 * type yes the type of the parameter
213 * length yes the max size of the parameter
214 */
215 function stored_procedure($package, $procedure, $params)
216 {
217 if ($package == '' OR $procedure == '' OR ! is_array($params))
218 {
219 if ($this->db_debug)
220 {
221 log_message('error', 'Invalid query: '.$package.'.'.$procedure);
222 return $this->display_error('db_invalid_query');
223 }
224 return FALSE;
225 }
226
227 // build the query string
228 $sql = "begin $package.$procedure(";
229
230 $have_cursor = FALSE;
231 foreach($params as $param)
232 {
233 $sql .= $param['name'] . ",";
234
235 if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR))
236 {
237 $have_cursor = TRUE;
238 }
239 }
240 $sql = trim($sql, ",") . "); end;";
241
242 $this->stmt_id = FALSE;
243 $this->_set_stmt_id($sql);
244 $this->_bind_params($params);
245 $this->query($sql, FALSE, $have_cursor);
246 }
247
248 // --------------------------------------------------------------------
249
250 /**
251 * Bind parameters
252 *
253 * @access private
254 * @return none
255 */
256 function _bind_params($params)
257 {
Derek Jones0b59f272008-05-13 04:22:33 +0000258 if ( ! is_array($params) OR ! is_resource($this->stmt_id))
Derek Allardd2df9bc2007-04-15 17:41:17 +0000259 {
260 return;
261 }
262
263 foreach ($params as $param)
264 {
265 foreach (array('name', 'value', 'type', 'length') as $val)
266 {
Derek Jones0b59f272008-05-13 04:22:33 +0000267 if ( ! isset($param[$val]))
Derek Allardd2df9bc2007-04-15 17:41:17 +0000268 {
269 $param[$val] = '';
270 }
271 }
272
273 ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']);
274 }
275 }
276
277 // --------------------------------------------------------------------
278
279 /**
280 * Begin Transaction
281 *
282 * @access public
283 * @return bool
284 */
285 function trans_begin($test_mode = FALSE)
286 {
Derek Jones0b59f272008-05-13 04:22:33 +0000287 if ( ! $this->trans_enabled)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000288 {
289 return TRUE;
290 }
291
292 // When transactions are nested we only begin/commit/rollback the outermost ones
293 if ($this->_trans_depth > 0)
294 {
295 return TRUE;
296 }
297
298 // Reset the transaction failure flag.
299 // If the $test_mode flag is set to TRUE transactions will be rolled back
300 // even if the queries produce a successful result.
301 $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
302
303 $this->_commit = OCI_DEFAULT;
304 return TRUE;
305 }
306
307 // --------------------------------------------------------------------
308
309 /**
310 * Commit Transaction
311 *
312 * @access public
313 * @return bool
314 */
315 function trans_commit()
316 {
Derek Jones0b59f272008-05-13 04:22:33 +0000317 if ( ! $this->trans_enabled)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000318 {
319 return TRUE;
320 }
321
322 // When transactions are nested we only begin/commit/rollback the outermost ones
323 if ($this->_trans_depth > 0)
324 {
325 return TRUE;
326 }
327
328 $ret = OCIcommit($this->conn_id);
329 $this->_commit = OCI_COMMIT_ON_SUCCESS;
330 return $ret;
331 }
332
333 // --------------------------------------------------------------------
334
335 /**
336 * Rollback Transaction
337 *
338 * @access public
339 * @return bool
340 */
341 function trans_rollback()
342 {
Derek Jones0b59f272008-05-13 04:22:33 +0000343 if ( ! $this->trans_enabled)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000344 {
345 return TRUE;
346 }
347
348 // When transactions are nested we only begin/commit/rollback the outermost ones
349 if ($this->_trans_depth > 0)
350 {
351 return TRUE;
352 }
353
354 $ret = OCIrollback($this->conn_id);
355 $this->_commit = OCI_COMMIT_ON_SUCCESS;
356 return $ret;
357 }
358
359 // --------------------------------------------------------------------
360
361 /**
362 * Escape String
363 *
364 * @access public
365 * @param string
366 * @return string
367 */
368 function escape_str($str)
369 {
Rick Ellis2cad6e92008-10-07 00:19:34 +0000370 return $this->input->CI->_remove_invisible_characters($str);
Derek Allardd2df9bc2007-04-15 17:41:17 +0000371 }
372
373 // --------------------------------------------------------------------
374
375 /**
376 * Affected Rows
377 *
378 * @access public
379 * @return integer
380 */
381 function affected_rows()
382 {
383 return @ocirowcount($this->stmt_id);
384 }
385
386 // --------------------------------------------------------------------
387
388 /**
389 * Insert ID
390 *
391 * @access public
392 * @return integer
393 */
394 function insert_id()
395 {
396 // not supported in oracle
Derek Allarddb708af2008-01-23 17:18:41 +0000397 return $this->display_error('db_unsupported_function');
Derek Allardd2df9bc2007-04-15 17:41:17 +0000398 }
399
400 // --------------------------------------------------------------------
401
402 /**
403 * "Count All" query
404 *
405 * Generates a platform-specific query string that counts all records in
406 * the specified database
407 *
408 * @access public
409 * @param string
410 * @return string
411 */
412 function count_all($table = '')
413 {
414 if ($table == '')
415 return '0';
416
Derek Allardf6cd45c2008-01-18 14:31:51 +0000417 $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table));
Derek Allardd2df9bc2007-04-15 17:41:17 +0000418
419 if ($query == FALSE)
420 {
421 return 0;
422 }
423
424 $row = $query->row();
425 return $row->NUMROWS;
426 }
427
428 // --------------------------------------------------------------------
429
430 /**
431 * Show table query
432 *
433 * Generates a platform-specific query string so that the table names can be fetched
434 *
435 * @access private
Derek Allard39b622d2008-01-16 21:10:09 +0000436 * @param boolean
Derek Allardd2df9bc2007-04-15 17:41:17 +0000437 * @return string
438 */
Derek Allard39b622d2008-01-16 21:10:09 +0000439 function _list_tables($prefix_limit = FALSE)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000440 {
Derek Allard39b622d2008-01-16 21:10:09 +0000441 $sql = "SELECT TABLE_NAME FROM ALL_TABLES";
442
443 if ($prefix_limit !== FALSE AND $this->dbprefix != '')
444 {
445 $sql .= " WHERE TABLE_NAME LIKE '".$this->dbprefix."%'";
446 }
447
448 return $sql;
Derek Allardd2df9bc2007-04-15 17:41:17 +0000449 }
450
451 // --------------------------------------------------------------------
452
453 /**
454 * Show column query
455 *
456 * Generates a platform-specific query string so that the column names can be fetched
457 *
458 * @access public
459 * @param string the table name
460 * @return string
461 */
462 function _list_columns($table = '')
463 {
464 return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'";
465 }
466
467 // --------------------------------------------------------------------
468
469 /**
470 * Field data query
471 *
472 * Generates a platform-specific query so that the column data can be retrieved
473 *
474 * @access public
475 * @param string the table name
476 * @return object
477 */
478 function _field_data($table)
479 {
480 return "SELECT * FROM ".$this->_escape_table($table)." where rownum = 1";
481 }
482
483 // --------------------------------------------------------------------
484
485 /**
486 * The error message string
487 *
488 * @access private
489 * @return string
490 */
491 function _error_message()
492 {
493 $error = ocierror($this->conn_id);
494 return $error['message'];
495 }
496
497 // --------------------------------------------------------------------
498
499 /**
500 * The error message number
501 *
502 * @access private
503 * @return integer
504 */
505 function _error_number()
506 {
507 $error = ocierror($this->conn_id);
508 return $error['code'];
509 }
Rick Ellis52dc8ca2008-09-30 19:53:52 +0000510
511 // --------------------------------------------------------------------
512
513 /**
514 * Escape Column Name
515 *
516 * This function adds backticks around supplied column name
517 *
518 * @access private
519 * @param string the column name
520 * @return string
521 */
522 function _escape_column($column)
523 {
524 // Probably not necessary with Oracle so we simply return the value
525 return $column;
526 }
Derek Allardd2df9bc2007-04-15 17:41:17 +0000527
528 // --------------------------------------------------------------------
529
530 /**
531 * Escape Table Name
532 *
533 * This function adds backticks if the table name has a period
534 * in it. Some DBs will get cranky unless periods are escaped
535 *
536 * @access private
537 * @param string the table name
538 * @return string
539 */
540 function _escape_table($table)
541 {
Derek Allardc0743382008-02-11 05:54:44 +0000542 if (strpos($table, '.') !== FALSE)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000543 {
Derek Allardc0743382008-02-11 05:54:44 +0000544 $table = '"' . str_replace('.', '"."', $table) . '"';
Derek Allardd2df9bc2007-04-15 17:41:17 +0000545 }
546
547 return $table;
548 }
549
550 // --------------------------------------------------------------------
551
552 /**
Derek Allard39b622d2008-01-16 21:10:09 +0000553 * Protect Identifiers
554 *
555 * This function adds backticks if appropriate based on db type
556 *
557 * @access private
558 * @param mixed the item to escape
559 * @param boolean only affect the first word
560 * @return mixed the item with backticks
561 */
562 function _protect_identifiers($item, $first_word_only = FALSE)
563 {
564 if (is_array($item))
565 {
566 $escaped_array = array();
567
568 foreach($item as $k=>$v)
569 {
570 $escaped_array[$this->_protect_identifiers($k)] = $this->_protect_identifiers($v, $first_word_only);
571 }
572
573 return $escaped_array;
574 }
575
576 // This function may get "item1 item2" as a string, and so
Derek Allard15648132008-02-10 21:46:18 +0000577 // we may need ""item1" "item2"" and not ""item1 item2""
Derek Allard61579382008-01-16 22:22:42 +0000578 if (ctype_alnum($item) === FALSE)
Derek Allard39b622d2008-01-16 21:10:09 +0000579 {
Derek Allard9b3e7b52008-02-04 23:20:34 +0000580 if (strpos($item, '.') !== FALSE)
581 {
582 $aliased_tables = implode(".",$this->ar_aliased_tables).'.';
583 $table_name = substr($item, 0, strpos($item, '.')+1);
584 $item = (strpos($aliased_tables, $table_name) !== FALSE) ? $item = $item : $this->dbprefix.$item;
585 }
586
Derek Allard15648132008-02-10 21:46:18 +0000587 // This function may get "field >= 1", and need it to return ""field" >= 1"
Derek Allard61579382008-01-16 22:22:42 +0000588 $lbound = ($first_word_only === TRUE) ? '' : '|\s|\(';
Derek Allard39b622d2008-01-16 21:10:09 +0000589
Derek Allard15648132008-02-10 21:46:18 +0000590 $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item);
Derek Allard61579382008-01-16 22:22:42 +0000591 }
592 else
593 {
Derek Allard15648132008-02-10 21:46:18 +0000594 return "\"{$item}\"";
Derek Allard39b622d2008-01-16 21:10:09 +0000595 }
596
Derek Allard9a4d1da2008-02-25 14:18:38 +0000597 $exceptions = array('AS', '/', '-', '%', '+', '*', 'OR', 'IS');
Derek Allard39b622d2008-01-16 21:10:09 +0000598
599 foreach ($exceptions as $exception)
600 {
Derek Allard61579382008-01-16 22:22:42 +0000601
Derek Allard15648132008-02-10 21:46:18 +0000602 if (stristr($item, " \"{$exception}\" ") !== FALSE)
Derek Allard39b622d2008-01-16 21:10:09 +0000603 {
Derek Allard15648132008-02-10 21:46:18 +0000604 $item = preg_replace('/ "('.preg_quote($exception).')" /i', ' $1 ', $item);
Derek Allard39b622d2008-01-16 21:10:09 +0000605 }
606 }
Derek Allard39b622d2008-01-16 21:10:09 +0000607 return $item;
608 }
609
610 // --------------------------------------------------------------------
611
612 /**
Derek Jonesc6ad0232008-01-29 18:44:54 +0000613 * From Tables
614 *
615 * This function implicitly groups FROM tables so there is no confusion
616 * about operator precedence in harmony with SQL standards
617 *
618 * @access public
619 * @param type
620 * @return type
621 */
622 function _from_tables($tables)
623 {
Derek Jones0b59f272008-05-13 04:22:33 +0000624 if ( ! is_array($tables))
Derek Jonesc6ad0232008-01-29 18:44:54 +0000625 {
626 $tables = array($tables);
627 }
628
Derek Allard15648132008-02-10 21:46:18 +0000629 return implode(', ', $tables);
Derek Jonesc6ad0232008-01-29 18:44:54 +0000630 }
631
632 // --------------------------------------------------------------------
633
634 /**
Derek Allardd2df9bc2007-04-15 17:41:17 +0000635 * Insert statement
636 *
637 * Generates a platform-specific insert string from the supplied data
638 *
639 * @access public
640 * @param string the table name
641 * @param array the insert keys
642 * @param array the insert values
643 * @return string
644 */
645 function _insert($table, $keys, $values)
646 {
647 return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
648 }
649
650 // --------------------------------------------------------------------
651
652 /**
653 * Update statement
654 *
655 * Generates a platform-specific update string from the supplied data
656 *
Derek Allard39b622d2008-01-16 21:10:09 +0000657 * @access public
658 * @param string the table name
659 * @param array the update data
660 * @param array the where clause
661 * @param array the orderby clause
662 * @param array the limit clause
663 * @return string
Derek Allardd2df9bc2007-04-15 17:41:17 +0000664 */
Derek Allard39b622d2008-01-16 21:10:09 +0000665 function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000666 {
667 foreach($values as $key => $val)
668 {
669 $valstr[] = $key." = ".$val;
670 }
Derek Allardda6d2402007-12-19 14:49:29 +0000671
Derek Jones0b59f272008-05-13 04:22:33 +0000672 $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
Derek Allard39b622d2008-01-16 21:10:09 +0000673
674 $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):'';
Derek Allardda6d2402007-12-19 14:49:29 +0000675
Derek Allard32cf7eb2008-02-05 16:03:50 +0000676 $sql = "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr);
677 $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : '';
678 $sql .= $orderby.$limit;
679
680 return $sql;
Derek Allardd2df9bc2007-04-15 17:41:17 +0000681 }
682
683 // --------------------------------------------------------------------
684
685 /**
Derek Allard39b622d2008-01-16 21:10:09 +0000686 * Truncate statement
687 *
688 * Generates a platform-specific truncate string from the supplied data
689 * If the database does not support the truncate() command
690 * This function maps to "DELETE FROM table"
691 *
692 * @access public
693 * @param string the table name
694 * @return string
695 */
696 function _truncate($table)
697 {
698 return "TRUNCATE TABLE ".$this->_escape_table($table);
699 }
700
701 // --------------------------------------------------------------------
702
703 /**
Derek Allardd2df9bc2007-04-15 17:41:17 +0000704 * Delete statement
705 *
706 * Generates a platform-specific delete string from the supplied data
707 *
Derek Allard39b622d2008-01-16 21:10:09 +0000708 * @access public
709 * @param string the table name
710 * @param array the where clause
711 * @param string the limit clause
712 * @return string
713 */
714 function _delete($table, $where = array(), $like = array(), $limit = FALSE)
Derek Allardd2df9bc2007-04-15 17:41:17 +0000715 {
Derek Allard39b622d2008-01-16 21:10:09 +0000716 $conditions = '';
717
Derek Jones0b59f272008-05-13 04:22:33 +0000718 if (count($where) > 0 OR count($like) > 0)
Derek Allard39b622d2008-01-16 21:10:09 +0000719 {
720 $conditions = "\nWHERE ";
721 $conditions .= implode("\n", $this->ar_where);
722
723 if (count($where) > 0 && count($like) > 0)
724 {
725 $conditions .= " AND ";
726 }
727 $conditions .= implode("\n", $like);
728 }
729
Derek Jones0b59f272008-05-13 04:22:33 +0000730 $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
Derek Allarde77d77c2007-12-19 15:01:55 +0000731
Derek Allard39b622d2008-01-16 21:10:09 +0000732 return "DELETE FROM ".$table.$conditions.$limit;
Derek Allardd2df9bc2007-04-15 17:41:17 +0000733 }
734
735 // --------------------------------------------------------------------
736
737 /**
738 * Limit string
739 *
740 * Generates a platform-specific LIMIT clause
741 *
742 * @access public
743 * @param string the sql query string
744 * @param integer the number of rows to limit the query to
745 * @param integer the offset value
746 * @return string
747 */
748 function _limit($sql, $limit, $offset)
749 {
750 $limit = $offset + $limit;
751 $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)";
752
753 if ($offset != 0)
754 {
755 $newsql .= " WHERE rnum >= $offset";
756 }
757
758 // remember that we used limits
759 $this->limit_used = TRUE;
760
761 return $newsql;
762 }
763
764 // --------------------------------------------------------------------
765
766 /**
767 * Close DB Connection
768 *
769 * @access public
770 * @param resource
771 * @return void
772 */
773 function _close($conn_id)
774 {
775 @ocilogoff($conn_id);
776 }
777
778
779}
780
781
Derek Jones0b59f272008-05-13 04:22:33 +0000782
783/* End of file oci8_driver.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000784/* Location: ./system/database/drivers/oci8/oci8_driver.php */