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 | |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 28 | /** |
| 29 | * Create database |
| 30 | * |
| 31 | * @access public |
| 32 | * @param string the database name |
| 33 | * @return bool |
| 34 | */ |
admin | 6cec6a5 | 2006-09-25 06:56:49 +0000 | [diff] [blame] | 35 | function _create_database($name) |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 36 | { |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 37 | return FALSE; |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | // -------------------------------------------------------------------- |
| 41 | |
| 42 | /** |
| 43 | * Drop database |
| 44 | * |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 45 | * @access private |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 46 | * @param string the database name |
| 47 | * @return bool |
| 48 | */ |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 49 | function _drop_database($name) |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 50 | { |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 51 | return FALSE; |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame] | 52 | } |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 53 | |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame] | 54 | // -------------------------------------------------------------------- |
| 55 | |
| 56 | /** |
| 57 | * List databases |
| 58 | * |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 59 | * @access private |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame] | 60 | * @return bool |
| 61 | */ |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 62 | function _list_databases() |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame] | 63 | { |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 64 | return FALSE; |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | // -------------------------------------------------------------------- |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame] | 68 | |
admin | 4ceac2d | 2006-09-25 06:40:16 +0000 | [diff] [blame] | 69 | /** |
| 70 | * Drop Table |
| 71 | * |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 72 | * @access private |
admin | 4ceac2d | 2006-09-25 06:40:16 +0000 | [diff] [blame] | 73 | * @return bool |
| 74 | */ |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 75 | function _drop_table($table) |
admin | 4ceac2d | 2006-09-25 06:40:16 +0000 | [diff] [blame] | 76 | { |
admin | 83b05a8 | 2006-09-25 21:06:46 +0000 | [diff] [blame] | 77 | return FALSE; |
admin | 4ceac2d | 2006-09-25 06:40:16 +0000 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | // -------------------------------------------------------------------- |
| 81 | |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame] | 82 | /** |
| 83 | * Version number query string |
| 84 | * |
| 85 | * @access public |
| 86 | * @return string |
| 87 | */ |
| 88 | function _version() |
| 89 | { |
| 90 | return ociserverversion($this->conn_id); |
| 91 | } |
| 92 | |
| 93 | // -------------------------------------------------------------------- |
| 94 | |
| 95 | /** |
| 96 | * Show table query |
| 97 | * |
| 98 | * Generates a platform-specific query string so that the table names can be fetched |
| 99 | * |
| 100 | * @access public |
| 101 | * @return string |
| 102 | */ |
| 103 | function _show_tables() |
| 104 | { |
| 105 | return "select TABLE_NAME FROM ALL_TABLES"; |
| 106 | } |
| 107 | |
| 108 | // -------------------------------------------------------------------- |
| 109 | |
| 110 | /** |
| 111 | * Show columnn query |
| 112 | * |
| 113 | * Generates a platform-specific query string so that the column names can be fetched |
| 114 | * |
| 115 | * @access public |
| 116 | * @param string the table name |
| 117 | * @return string |
| 118 | */ |
| 119 | function _show_columns($table = '') |
| 120 | { |
| 121 | return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; |
| 122 | } |
| 123 | |
| 124 | // -------------------------------------------------------------------- |
| 125 | |
| 126 | /** |
| 127 | * Field data query |
| 128 | * |
| 129 | * Generates a platform-specific query so that the column data can be retrieved |
| 130 | * |
| 131 | * @access public |
| 132 | * @param string the table name |
| 133 | * @return object |
| 134 | */ |
| 135 | function _field_data($table) |
| 136 | { |
admin | 6cec6a5 | 2006-09-25 06:56:49 +0000 | [diff] [blame] | 137 | return "SELECT * FROM ".$this->db->_escape_table($table)." where rownum = 1"; |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame] | 138 | } |
| 139 | |
admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 140 | |
admin | ab4f61b | 2006-09-25 22:12:32 +0000 | [diff] [blame] | 141 | // -------------------------------------------------------------------- |
| 142 | |
| 143 | /** |
| 144 | * Optimize table query |
| 145 | * |
| 146 | * Generates a platform-specific query so that a table can be optimized |
| 147 | * |
| 148 | * @access private |
| 149 | * @param string the table name |
| 150 | * @return object |
| 151 | */ |
| 152 | function _optimize_table($table) |
| 153 | { |
| 154 | return FALSE; // Is this supported in Oracle? |
| 155 | } |
| 156 | |
| 157 | // -------------------------------------------------------------------- |
| 158 | |
| 159 | /** |
| 160 | * Repair table query |
| 161 | * |
| 162 | * Generates a platform-specific query so that a table can be repaired |
| 163 | * |
| 164 | * @access private |
| 165 | * @param string the table name |
| 166 | * @return object |
| 167 | */ |
| 168 | function _repair_table($table) |
| 169 | { |
| 170 | return return FALSE; // Is this supported in Oracle? |
| 171 | } |
| 172 | |
admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | ?> |