当前位置: 首页>>代码示例>>PHP>>正文


PHP ocicolumntype函数代码示例

本文整理汇总了PHP中ocicolumntype函数的典型用法代码示例。如果您正苦于以下问题:PHP ocicolumntype函数的具体用法?PHP ocicolumntype怎么用?PHP ocicolumntype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ocicolumntype函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @access  public
  * @return  array
  */
 function field_data()
 {
     $retval = array();
     $fieldCount = $this->num_fields();
     for ($c = 1; $c <= $fieldCount; $c++) {
         $F = new stdClass();
         $F->name = ocicolumnname($this->stmt_id, $c);
         $F->type = ocicolumntype($this->stmt_id, $c);
         $F->max_length = ocicolumnsize($this->stmt_id, $c);
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:nigelpeters,项目名称:css-recruitment-ee,代码行数:21,代码来源:oci8_result.php

示例2: write_data

 function write_data($table_name)
 {
     global $db;
     $ary_type = $ary_name = array();
     // Grab all of the data from current table.
     $sql = "SELECT *\n\t\t\tFROM {$table_name}";
     $result = $db->sql_query($sql);
     $i_num_fields = ocinumcols($result);
     for ($i = 0; $i < $i_num_fields; $i++) {
         $ary_type[$i] = ocicolumntype($result, $i + 1);
         $ary_name[$i] = ocicolumnname($result, $i + 1);
     }
     $sql_data = '';
     while ($row = $db->sql_fetchrow($result)) {
         $schema_vals = $schema_fields = array();
         // Build the SQL statement to recreate the data.
         for ($i = 0; $i < $i_num_fields; $i++) {
             // Oracle uses uppercase - we use lowercase
             $str_val = $row[strtolower($ary_name[$i])];
             if (preg_match('#char|text|bool|raw|clob#i', $ary_type[$i])) {
                 $str_quote = '';
                 $str_empty = "''";
                 $str_val = sanitize_data_oracle($str_val);
             } else {
                 if (preg_match('#date|timestamp#i', $ary_type[$i])) {
                     if (empty($str_val)) {
                         $str_quote = '';
                     } else {
                         $str_quote = "'";
                     }
                 } else {
                     $str_quote = '';
                     $str_empty = 'NULL';
                 }
             }
             if (empty($str_val) && $str_val !== '0') {
                 $str_val = $str_empty;
             }
             $schema_vals[$i] = $str_quote . $str_val . $str_quote;
             $schema_fields[$i] = '"' . $ary_name[$i] . '"';
         }
         // Take the ordered fields and their associated data and build it
         // into a valid sql statement to recreate that field in the data.
         $sql_data = "INSERT INTO {$table_name} (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ")\n/\n";
         $this->flush($sql_data);
     }
     $db->sql_freeresult($result);
 }
开发者ID:eyumay,项目名称:ju.ejhs,代码行数:48,代码来源:acp_database.php

示例3: DBfetch

function DBfetch(&$cursor)
{
    global $DB;
    $result = false;
    if (isset($DB['DB']) && !empty($DB['DB'])) {
        switch ($DB['TYPE']) {
            case 'MYSQL':
                $result = mysql_fetch_assoc($cursor);
                break;
            case 'POSTGRESQL':
                $result = pg_fetch_assoc($cursor);
                break;
            case 'ORACLE':
                if (ocifetchinto($cursor, $row, OCI_ASSOC + OCI_RETURN_NULLS)) {
                    $result = array();
                    foreach ($row as $key => $value) {
                        $result[strtolower($key)] = str_in_array(strtolower(ocicolumntype($cursor, $key)), array('varchar', 'varchar2', 'blob', 'clob')) && is_null($value) ? '' : $value;
                    }
                }
                break;
            case 'SQLITE3':
                if ($cursor) {
                    $result = array_shift($cursor);
                    if (is_null($result)) {
                        $result = false;
                    }
                }
                break;
        }
    }
    return $result;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:32,代码来源:db.inc.php

示例4: FieldType

 function FieldType($rsMain, $i)
 {
     return ocicolumntype($rsMain, $i + 1);
 }
开发者ID:modulexcite,项目名称:frameworks,代码行数:4,代码来源:dbClass2.php

示例5: main


//.........这里部分代码省略.........
                                                        $str_empty = 'NULL';
                                                    }
                                                }
                                                if (empty($str_val) && $str_val !== '0') {
                                                    $str_val = $str_empty;
                                                }
                                                $schema_vals[$i] = $str_quote . $str_val . $str_quote;
                                                $schema_fields[$i] = "'" . $ary_name[$i] . "'";
                                            }
                                            // Take the ordered fields and their associated data and build it
                                            // into a valid sql statement to recreate that field in the data.
                                            $sql_data .= "INSERT INTO {$table_name} (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
                                            if ($store == true) {
                                                $write($fp, $sql_data);
                                            }
                                            if ($download == true) {
                                                if (!empty($oper)) {
                                                    echo $oper($sql_data);
                                                } else {
                                                    echo $sql_data;
                                                }
                                            }
                                            $sql_data = '';
                                        }
                                        $db->sql_freeresult($result);
                                        break;
                                    case 'oracle':
                                        $ary_type = $ary_name = array();
                                        // Grab all of the data from current table.
                                        $sql = "SELECT *\n\t\t\t\t\t\t\t\t\t\t\tFROM {$table_name}";
                                        $result = $db->sql_query($sql);
                                        $i_num_fields = ocinumcols($result);
                                        for ($i = 0; $i < $i_num_fields; $i++) {
                                            $ary_type[$i] = ocicolumntype($result, $i);
                                            $ary_name[$i] = ocicolumnname($result, $i);
                                        }
                                        while ($row = $db->sql_fetchrow($result)) {
                                            $schema_vals = $schema_fields = array();
                                            // Build the SQL statement to recreate the data.
                                            for ($i = 0; $i < $i_num_fields; $i++) {
                                                $str_val = $row[$ary_name[$i]];
                                                if (preg_match('#char|text|bool#i', $ary_type[$i])) {
                                                    $str_quote = "'";
                                                    $str_empty = '';
                                                    $str_val = addslashes($str_val);
                                                } else {
                                                    if (preg_match('#date|timestamp#i', $ary_type[$i])) {
                                                        if (empty($str_val)) {
                                                            $str_quote = '';
                                                        } else {
                                                            $str_quote = "'";
                                                        }
                                                    } else {
                                                        $str_quote = '';
                                                        $str_empty = 'NULL';
                                                    }
                                                }
                                                if (empty($str_val) && $str_val !== '0') {
                                                    $str_val = $str_empty;
                                                }
                                                $schema_vals[$i] = $str_quote . $str_val . $str_quote;
                                                $schema_fields[$i] = '"' . $ary_name[$i] . "'";
                                            }
                                            // Take the ordered fields and their associated data and build it
                                            // into a valid sql statement to recreate that field in the data.
                                            $sql_data .= "INSERT INTO {$table_name} (" . implode(', ', $schema_fields) . ') VALUES(' . implode(', ', $schema_vals) . ");\n";
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_database.php

示例6: fetch_field

 /**
  * Get column information
  * @param  int
  * @return object
  */
 protected function fetch_field($intOffset)
 {
     // Oracle starts row counting at 1
     ++$intOffset;
     $arrData['name'] = @ocicolumnname($this->resResult, $intOffset);
     $arrData['max_length'] = @ocicolumnsize($this->resResult, $intOffset);
     $arrData['not_null'] = @ocicolumnisnull($this->resResult, $intOffset);
     $arrData['type'] = @ocicolumntype($this->resResult, $intOffset);
     return $arrData;
 }
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:15,代码来源:DB_Oracle.php

示例7: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @access  public
  * @return  array
  */
 function field_data()
 {
     $retval = array();
     $fieldCount = $this->num_fields();
     for ($c = 1; $c <= $fieldCount; $c++) {
         $F = new stdClass();
         $F->name = ocicolumnname($this->stmt_id, $c);
         $F->type = ocicolumntype($this->stmt_id, $c);
         $F->max_length = ocicolumnsize($this->stmt_id, $c);
         $F->length = $this->getColumnLength($c);
         $F->longest = $this->getColumnLongest($c);
         $F->primary_key = $this->isColumnPrimaryKey($c);
         $F->unique = $this->isColumnUnique($c);
         $F->part_of_key = $this->isColumnPartOfKey($c);
         $F->autoIncrement = $this->isColumnAutoIncrement($c);
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:rotac,项目名称:ci_package-abstraction,代码行数:27,代码来源:oci10_result.php

示例8: fetch_field

 /**
  * Get the column information
  * @param integer
  * @return object
  */
 protected function fetch_field($intOffset)
 {
     ++$intOffset;
     // Oracle starts row counting at 1
     $objData = new stdClass();
     $objData->name = @ocicolumnname($this->resResult, $intOffset);
     $objData->max_length = @ocicolumnsize($this->resResult, $intOffset);
     $objData->not_null = @ocicolumnisnull($this->resResult, $intOffset);
     $objData->type = @ocicolumntype($this->resResult, $intOffset);
     return $objData;
 }
开发者ID:jens-wetzel,项目名称:use2,代码行数:16,代码来源:DB_Oracle.php

示例9: db_get_query_rows

 /**
  * Get the rows returned from a SELECT query.
  *
  * @param  resource		The query result pointer
  * @param  ?integer		Whether to start reading from (NULL: irrelevant for this forum driver)
  * @return array			A list of row maps
  */
 function db_get_query_rows($stmt, $start = NULL)
 {
     $out = array();
     $i = 0;
     $num_fields = ocinumcols($stmt);
     $types = array();
     $names = array();
     for ($x = 1; $x <= $num_fields; $x++) {
         $types[$x] = ocicolumntype($stmt, $x);
         $names[$x] = strtolower(ocicolumnname($stmt, $x));
     }
     while (ocifetch($stmt)) {
         if (is_null($start) || $i >= $start) {
             $newrow = array();
             for ($j = 1; $j <= $num_fields; $j++) {
                 $v = ociresult($stmt, $j);
                 if (is_object($v)) {
                     $v = $v->load();
                 }
                 // For CLOB's
                 if ($v === false) {
                     fatal_exit(do_lang_tempcode('QUERY_FAILED', ocierror($stmt)));
                 }
                 $name = $names[$j];
                 $type = $types[$j];
                 if ($type == 'NUMBER') {
                     if (!is_null($v)) {
                         $newrow[$name] = intval($v);
                     } else {
                         $newrow[$name] = NULL;
                     }
                 } else {
                     if ($v == ' ') {
                         $v = '';
                     }
                     $newrow[$name] = $v;
                 }
             }
             $out[] = $newrow;
         }
         $i++;
     }
     return $out;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:51,代码来源:oracle.php

示例10: ocibindbyname

ocibindbyname();
ocicancel();
ocicloselob();
ocicollappend();
ocicollassign();
ocicollassignelem();
ocicollgetelem();
ocicollmax();
ocicollsize();
ocicolltrim();
ocicolumnisnull();
ocicolumnname();
ocicolumnprecision();
ocicolumnscale();
ocicolumnsize();
ocicolumntype();
ocicolumntyperaw();
ocicommit();
ocidefinebyname();
ocierror();
ociexecute();
ocifetch();
ocifetchinto();
ocifetchstatement();
ocifreecollection();
ocifreecursor();
ocifreedesc();
ocifreestatement();
ociinternaldebug();
ociloadlob();
ocilogoff();
开发者ID:christopheg,项目名称:PHPCompatibility,代码行数:31,代码来源:deprecated_functions.php


注:本文中的ocicolumntype函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。