admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 1 | <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
| 2 | /** |
| 3 | * Code Igniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 4.3.2 or newer |
| 6 | * |
| 7 | * @package CodeIgniter |
| 8 | * @author Rick Ellis |
| 9 | * @copyright Copyright (c) 2006, pMachine, Inc. |
| 10 | * @license http://www.codeignitor.com/user_guide/license.html |
| 11 | * @link http://www.codeigniter.com |
| 12 | * @since Version 1.0 |
| 13 | * @filesource |
| 14 | */ |
| 15 | |
| 16 | // ------------------------------------------------------------------------ |
| 17 | |
| 18 | /** |
| 19 | * Oracle Utility Class |
| 20 | * |
| 21 | * @category Database |
| 22 | * @author Rick Ellis |
| 23 | * @link http://www.codeigniter.com/user_guide/database/ |
| 24 | */ |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame^] | 25 | class CI_DB_oci8_utility extends CI_DB_utility { |
| 26 | |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * Version number query string |
| 31 | * |
| 32 | * @access public |
| 33 | * @return string |
| 34 | */ |
| 35 | function _version() |
| 36 | { |
| 37 | return ociserverversion($this->conn_id); |
| 38 | } |
| 39 | |
| 40 | // -------------------------------------------------------------------- |
| 41 | |
| 42 | /** |
| 43 | * Show table query |
| 44 | * |
| 45 | * Generates a platform-specific query string so that the table names can be fetched |
| 46 | * |
| 47 | * @access public |
| 48 | * @return string |
| 49 | */ |
| 50 | function _show_tables() |
| 51 | { |
| 52 | return "select TABLE_NAME FROM ALL_TABLES"; |
| 53 | } |
| 54 | |
| 55 | // -------------------------------------------------------------------- |
| 56 | |
| 57 | /** |
| 58 | * Show columnn query |
| 59 | * |
| 60 | * Generates a platform-specific query string so that the column names can be fetched |
| 61 | * |
| 62 | * @access public |
| 63 | * @param string the table name |
| 64 | * @return string |
| 65 | */ |
| 66 | function _show_columns($table = '') |
| 67 | { |
| 68 | return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; |
| 69 | } |
| 70 | |
| 71 | // -------------------------------------------------------------------- |
| 72 | |
| 73 | /** |
| 74 | * Field data query |
| 75 | * |
| 76 | * Generates a platform-specific query so that the column data can be retrieved |
| 77 | * |
| 78 | * @access public |
| 79 | * @param string the table name |
| 80 | * @return object |
| 81 | */ |
| 82 | function _field_data($table) |
| 83 | { |
| 84 | $sql = "SELECT * FROM ".$this->db->_escape_table($table)." where rownum = 1"; |
| 85 | $query = $this->db->query($sql); |
| 86 | return $query->field_data(); |
| 87 | } |
| 88 | |
admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 89 | |
| 90 | } |
| 91 | |
| 92 | ?> |