blob: 837c8c88101d41fff8d51a4aceb9c1d80b24b190 [file] [log] [blame]
admin7b613c72006-09-24 18:05:17 +00001<?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 * ODBC Utility Class
20 *
21 * @category Database
22 * @author Rick Ellis
23 * @link http://www.codeigniter.com/database/
24 */
admina5e812c2006-09-25 02:17:30 +000025class CI_DB_odbc_utility extends CI_DB_utility {
26
admin7b613c72006-09-24 18:05:17 +000027 /**
admina5e812c2006-09-25 02:17:30 +000028 * Version number query string
admin7b613c72006-09-24 18:05:17 +000029 *
30 * @access public
admina5e812c2006-09-25 02:17:30 +000031 * @return string
admin7b613c72006-09-24 18:05:17 +000032 */
admina5e812c2006-09-25 02:17:30 +000033 function _version()
admin7b613c72006-09-24 18:05:17 +000034 {
admina5e812c2006-09-25 02:17:30 +000035 return "SELECT version() AS ver";
admin7b613c72006-09-24 18:05:17 +000036 }
37
38 // --------------------------------------------------------------------
39
admina5e812c2006-09-25 02:17:30 +000040 /**
41 * Show table query
42 *
43 * Generates a platform-specific query string so that the table names can be fetched
44 *
45 * @access public
46 * @return string
47 */
48 function _show_tables()
49 {
50 return "SHOW TABLES FROM `".$this->db->database."`";
51 }
52
53 // --------------------------------------------------------------------
54
55 /**
56 * Show columnn query
57 *
58 * Generates a platform-specific query string so that the column names can be fetched
59 *
60 * @access public
61 * @param string the table name
62 * @return string
63 */
64 function _show_columns($table = '')
65 {
66 return "SHOW COLUMNS FROM ".$this->db->_escape_table($table);
67 }
68
69 // --------------------------------------------------------------------
70
71 /**
72 * Field data query
73 *
74 * Generates a platform-specific query so that the column data can be retrieved
75 *
76 * @access public
77 * @param string the table name
78 * @return object
79 */
80 function _field_data($table)
81 {
82 $sql = "SELECT TOP 1 FROM ".$this->db->_escape_table($table);
83 $query = $this->db->query($sql);
84 return $query->field_data();
85 }
86
87
88
admin7b613c72006-09-24 18:05:17 +000089}
90
91?>