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 | */ |
| 35 | function create_database($name) |
| 36 | { |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | // -------------------------------------------------------------------- |
| 40 | |
| 41 | /** |
| 42 | * Drop database |
| 43 | * |
| 44 | * @access public |
| 45 | * @param string the database name |
| 46 | * @return bool |
| 47 | */ |
| 48 | function drop_database($name) |
| 49 | { |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame^] | 50 | } |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 51 | |
admin | 7249637 | 2006-09-25 03:44:04 +0000 | [diff] [blame^] | 52 | // -------------------------------------------------------------------- |
| 53 | |
| 54 | /** |
| 55 | * List databases |
| 56 | * |
| 57 | * @access public |
| 58 | * @return bool |
| 59 | */ |
| 60 | function list_databases() |
| 61 | { |
admin | 6ca6f94 | 2006-09-25 02:51:08 +0000 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | // -------------------------------------------------------------------- |
admin | a5e812c | 2006-09-25 02:17:30 +0000 | [diff] [blame] | 65 | |
| 66 | /** |
| 67 | * Version number query string |
| 68 | * |
| 69 | * @access public |
| 70 | * @return string |
| 71 | */ |
| 72 | function _version() |
| 73 | { |
| 74 | return ociserverversion($this->conn_id); |
| 75 | } |
| 76 | |
| 77 | // -------------------------------------------------------------------- |
| 78 | |
| 79 | /** |
| 80 | * Show table query |
| 81 | * |
| 82 | * Generates a platform-specific query string so that the table names can be fetched |
| 83 | * |
| 84 | * @access public |
| 85 | * @return string |
| 86 | */ |
| 87 | function _show_tables() |
| 88 | { |
| 89 | return "select TABLE_NAME FROM ALL_TABLES"; |
| 90 | } |
| 91 | |
| 92 | // -------------------------------------------------------------------- |
| 93 | |
| 94 | /** |
| 95 | * Show columnn query |
| 96 | * |
| 97 | * Generates a platform-specific query string so that the column names can be fetched |
| 98 | * |
| 99 | * @access public |
| 100 | * @param string the table name |
| 101 | * @return string |
| 102 | */ |
| 103 | function _show_columns($table = '') |
| 104 | { |
| 105 | return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; |
| 106 | } |
| 107 | |
| 108 | // -------------------------------------------------------------------- |
| 109 | |
| 110 | /** |
| 111 | * Field data query |
| 112 | * |
| 113 | * Generates a platform-specific query so that the column data can be retrieved |
| 114 | * |
| 115 | * @access public |
| 116 | * @param string the table name |
| 117 | * @return object |
| 118 | */ |
| 119 | function _field_data($table) |
| 120 | { |
| 121 | $sql = "SELECT * FROM ".$this->db->_escape_table($table)." where rownum = 1"; |
| 122 | $query = $this->db->query($sql); |
| 123 | return $query->field_data(); |
| 124 | } |
| 125 | |
admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 126 | |
| 127 | } |
| 128 | |
| 129 | ?> |