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


PHP oci_num_fields函数代码示例

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


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

示例1: doQuery

 /**
 	Execute an SQL query.
 
 	@param	$sQueryString	The query string
 	@return	weeDatabaseDummyResult	Only with SELECT queries: an object for results handling
 */
 protected function doQuery($sQueryString)
 {
     $rStatement = oci_parse($this->rLink, $sQueryString);
     $rStatement !== false or burn('DatabaseException', sprintf(_WT("Failed to parse the query with the following error:\n%s"), array_value(oci_error($this->rLink), 'message')));
     // oci_execute triggers a warning when the statement could not be executed.
     @oci_execute($rStatement, OCI_DEFAULT) or burn('DatabaseException', sprintf(_WT("Failed to execute the query with the following error:\n%s"), array_value(oci_error($rStatement), 'message')));
     $this->iNumAffectedRows = oci_num_rows($rStatement);
     if (oci_num_fields($rStatement) > 0) {
         // TODO: Check whether the silence operator is really required here.
         @oci_fetch_all($rStatement, $aRows, 0, -1, OCI_ASSOC | OCI_FETCHSTATEMENT_BY_ROW);
         return new weeDatabaseDummyResult($aRows);
     }
 }
开发者ID:extend,项目名称:wee,代码行数:19,代码来源:weeOracleDatabase.class.php

示例2: o_fetch_all

 public function o_fetch_all($query, $action, $params = array(), $f_mode)
 {
     $result = array();
     $this->execute($query, $action, $params);
     $result["count"] = oci_num_fields($this->stid);
     oci_fetch_all($this->stid, $res, 0, -1, $f_mode);
     $result["data"] = $res;
     $this->stid = null;
     return $result;
 }
开发者ID:kwakucsc,项目名称:php_framework,代码行数:10,代码来源:Oracle.php

示例3: cargarArray

function cargarArray($FUPE_CD_PROMOTOR, $FUPE_FE_ESTADO_DESDE, $FUPE_FE_ESTADO_HASTA, $queries)
{
    include dirname(__FILE__) . '/conectar_ORACLE.php';
    //echo $queries.";<br /><br />";
    $array = array();
    $query = oci_parse($c, $queries);
    oci_execute($query);
    $error = 0;
    $ncols = oci_num_fields($query);
    $cont = 0;
    $j = 0;
    $k = 0;
    while ($row = oci_fetch_array($query, OCI_BOTH + OCI_RETURN_NULLS)) {
        while ($cont < $ncols) {
            $array[$j][$cont] = $row[$cont];
            $cont++;
        }
        $cont = 0;
        $k = 0;
        $j++;
    }
    if (oci_num_rows($query) == 0) {
        return false;
    } else {
        return $array;
    }
}
开发者ID:erosennin93,项目名称:CPI,代码行数:27,代码来源:totalesVendedorAM_datos.php

示例4: cargarArray

function cargarArray($sentencia)
{
    include dirname(__FILE__) . '/conectar_ORACLE.php';
    $array = array();
    $sentenciaExec = oci_parse($c, $sentencia);
    oci_execute($sentenciaExec);
    $error = 0;
    $k = 0;
    $ncols = oci_num_fields($sentenciaExec);
    for ($i = 1; $i <= $ncols; ++$i) {
        $colname = oci_field_name($sentenciaExec, $i);
        $array[0][$k] = $colname;
        $k++;
    }
    $cont = 0;
    $j = 1;
    $k = 0;
    while ($row = oci_fetch_array($sentenciaExec, OCI_BOTH + OCI_RETURN_NULLS)) {
        while ($cont < $ncols) {
            $array[$j][$cont] = $row[$cont];
            $cont++;
        }
        $cont = 0;
        $k = 0;
        $j++;
    }
    if (oci_num_rows($sentenciaExec) == 0) {
        oci_free_statement($sentenciaExec);
        return false;
    } else {
        oci_free_statement($sentenciaExec);
        return $array;
    }
}
开发者ID:ezeed,项目名称:CPI,代码行数:34,代码来源:functions.php

示例5: GetData

 function GetData($_start, $_count = 999999)
 {
     $_tpl_select_command = "SELECT {fields} FROM ( SELECT a.*, rownum rnum FROM ({SelectCommand}) a WHERE rownum <= " . ($_start + $_count) . " ) WHERE rnum >= " . $_start . " {where} {orderby} {groupby}";
     //Fields
     $_fields = "";
     $_fld_array = array();
     $_st_id = oci_parse($this->_Link, $this->SelectCommand);
     if ($_st_id) {
         oci_execute($_st_id);
         $_num_fields = oci_num_fields($_st_id);
         for ($i = 1; $i <= $_num_fields; $i++) {
             array_push($_fld_array, '"' . oci_field_name($_st_id, $i) . '"');
         }
     }
     for ($i = 0; $i < sizeof($_fld_array); $i++) {
         $_fields .= ", " . $_fld_array[$i];
     }
     if ($_fields != "") {
         $_fields = substr($_fields, 2);
     }
     //Filters
     $_where = "";
     $_filters = $this->Filters;
     for ($i = 0; $i < sizeof($_filters); $i++) {
         $_where .= " and " . $this->GetFilterExpression($_filters[$i]);
     }
     //Order
     $_orderby = "";
     $_orders = $this->Sorts;
     for ($i = 0; $i < sizeof($_orders); $i++) {
         $_orderby .= ", " . $_orders[$i]->Field . " " . $_orders[$i]->Order;
     }
     if ($_orderby != "") {
         $_orderby = "ORDER BY " . substr($_orderby, 2);
     }
     //Group
     $_groupby = "";
     $_groups = $this->Groups;
     for ($i = 0; $i < sizeof($_groups); $i++) {
         $_groupby .= ", " . $_groups[$i]->Field;
     }
     if ($_groupby != "") {
         $_groupby = "GROUP BY " . substr($_groupby, 2);
     }
     $_select_command = str_replace("{fields}", $_fields, $_tpl_select_command);
     $_select_command = str_replace("{SelectCommand}", $this->SelectCommand, $_select_command);
     $_select_command = str_replace("{where}", $_where, $_select_command);
     $_select_command = str_replace("{orderby}", $_orderby, $_select_command);
     $_select_command = str_replace("{groupby}", $_groupby, $_select_command);
     $_rows = array();
     $_st_id = oci_parse($this->_Link, $_select_command);
     if ($_st_id) {
         oci_execute($_st_id);
         while ($_row = oci_fetch_array($_st_id, OCI_ASSOC + OCI_RETURN_NULLS)) {
             array_push($_rows, $_row);
         }
     }
     return $_rows;
 }
开发者ID:skydel,项目名称:universal-online-exam,代码行数:59,代码来源:OracleDataSource.php

示例6: num_fields

 /**
  * Number of fields in the result set
  *
  * @access  public
  * @return  integer
  */
 public function num_fields()
 {
     $count = @oci_num_fields($this->stmt_id);
     // if we used a limit we subtract it
     if ($this->limit_used) {
         $count = $count - 1;
     }
     return $count;
 }
开发者ID:madhavipuliraju,项目名称:outreach-portal,代码行数:15,代码来源:oci8_result.php

示例7: getResultFields

 public function getResultFields()
 {
     if (empty($this->resultFields)) {
         $numFields = oci_num_fields($this->resource);
         for ($i = 0; $i < $numFields; $i++) {
             $this->resultFields[$i] = array("name" => oci_field_name($this->resource, $i + 1), "type" => oci_field_type($this->resource, $i + 1));
         }
     }
     return $this->resultFields;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:10,代码来源:oracleresult.php

示例8: __construct

 /**
  * @param Statement $statement
  */
 public function __construct(Statement $statement)
 {
     $this->statement = $statement;
     $this->statement->execute(Executor::NO_COMMIT);
     // no reason to auto-commit after SELECT statements
     // set attributes
     $this->numFields = oci_num_fields($this->statement->getResource());
     $this->setColumnNames();
     $this->setColumnTypes();
 }
开发者ID:winkbrace,项目名称:oracle,代码行数:13,代码来源:Fetcher.php

示例9: oci_num_fields

 public static function oci_num_fields($connection, $statement)
 {
     self::checkOCIExtension('oci_num_fields');
     $columnCount = @oci_num_fields($statement);
     if ($columnCount === FALSE) {
         $error = oci_error($connection);
         throw new IllegalStateException(t('Could not retrieve the number of result columns in a statement: @error', array('@error' => t($error['message']))));
     }
     return $columnCount;
 }
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:10,代码来源:OCIImplHelper.php

示例10: paginate

 function paginate($start, $limit)
 {
     // Extract the fields being selected (swiped from PEAR::DB)
     $sql = "SELECT * FROM ({$this->sql}) WHERE 1=1";
     $stmt = new lmbOciStatement($this->connection, $sql);
     $queryId = $this->connection->executeStatement($stmt->getStatement());
     $ncols = oci_num_fields($queryId);
     $cols = array();
     for ($i = 1; $i <= $ncols; $i++) {
         $cols[] = '"' . oci_field_name($queryId, $i) . '"';
     }
     $fields = implode(',', $cols);
     // Build the paginated query...
     $sql = "SELECT {$fields} FROM" . "  (SELECT rownum as linenum, {$fields} FROM" . "      ({$this->sql})" . '  WHERE rownum <= ' . ($start + $limit) . ') WHERE linenum >= ' . ++$start;
     $this->sql = $sql;
 }
开发者ID:knevcher,项目名称:limb,代码行数:16,代码来源:lmbOciQueryStatement.class.php

示例11: getFields

 /**
  * Returns an array of fields according to columns in the result.
  *
  * @return \Bitrix\Main\Entity\ScalarField[]
  */
 public function getFields()
 {
     if ($this->resultFields == null) {
         $this->resultFields = array();
         if (is_resource($this->resource)) {
             $numFields = oci_num_fields($this->resource);
             if ($numFields > 0 && $this->connection) {
                 $helper = $this->connection->getSqlHelper();
                 for ($i = 1; $i <= $numFields; $i++) {
                     $name = oci_field_name($this->resource, $i);
                     $type = oci_field_type($this->resource, $i);
                     $parameters = array("precision" => oci_field_precision($this->resource, $i), "scale" => oci_field_scale($this->resource, $i), "size" => oci_field_size($this->resource, $i));
                     $this->resultFields[$name] = $helper->getFieldByColumnType($name, $type, $parameters);
                 }
             }
         }
     }
     return $this->resultFields;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:24,代码来源:oracleresult.php

示例12: oci_free_statement

             echo "<td>" . $row[$NUM_COL] . "</td>";
         }
         $NUM_COL++;
     }
     echo "<td><a href='inicio_vermas.php?ESTADO={$NUM_HREF}'>Ver más</a></td>";
     echo "</tr>";
     $NUM_COL = 0;
     $NUM_HREF++;
 }
 echo "</table>\n";
 echo "</div>";
 oci_free_statement($Duplicados1);
 echo "<div class='sixteen columns'>";
 echo "<h3>Procesos Automaticos</h3>";
 echo "<table class='standard-table'>";
 $ncols = oci_num_fields($Controles1);
 echo "<tr>\n";
 for ($i = 1; $i <= $ncols; ++$i) {
     $colname = oci_field_name($Controles1, $i);
     echo "  <th><b>" . htmlentities($colname, ENT_QUOTES) . "</b></th>\n";
 }
 echo "</tr>\n";
 while ($row = oci_fetch_array($Controles1, OCI_BOTH + OCI_RETURN_NULLS)) {
     //Genero las columnas dinamicamente
     echo "<tr>";
     while ($NUM_COL < $ncols) {
         if ($NUM_COL == 1) {
             if ($row[$NUM_COL] == 0) {
                 echo "<td class=\"vacio\">" . $row[$NUM_COL] . "</td>";
             } else {
                 echo "<td class=\"lleno\">" . $row[$NUM_COL] . "</td>";
开发者ID:erosennin93,项目名称:CPI,代码行数:31,代码来源:inicio.php

示例13: querY

function querY($type, $host, $user, $pass, $db = '', $query)
{
    $res = '';
    switch ($type) {
        case 'MySQL':
            if (!function_exists('mysql_connect')) {
                return 0;
            }
            $link = mysql_connect($host, $user, $pass);
            if ($link) {
                if (!empty($db)) {
                    mysql_select_db($db, $link);
                }
                $result = mysql_query($query, $link);
                while ($data = mysql_fetch_row($result)) {
                    $res .= implode('|-|-|-|-|-|', $data) . '|+|+|+|+|+|';
                }
                $res .= '[+][+][+]';
                for ($i = 0; $i < mysql_num_fields($result); $i++) {
                    $res .= mysql_field_name($result, $i) . '[-][-][-]';
                }
                mysql_close($link);
                return $res;
            }
            break;
        case 'MSSQL':
            if (!function_exists('mssql_connect')) {
                return 0;
            }
            $link = mssql_connect($host, $user, $pass);
            if ($link) {
                if (!empty($db)) {
                    mssql_select_db($db, $link);
                }
                $result = mssql_query($query, $link);
                while ($data = mssql_fetch_row($result)) {
                    $res .= implode('|-|-|-|-|-|', $data) . '|+|+|+|+|+|';
                }
                $res .= '[+][+][+]';
                for ($i = 0; $i < mssql_num_fields($result); $i++) {
                    $res .= mssql_field_name($result, $i) . '[-][-][-]';
                }
                mssql_close($link);
                return $res;
            }
            break;
        case 'Oracle':
            if (!function_exists('ocilogon')) {
                return 0;
            }
            $link = ocilogon($user, $pass, $db);
            if ($link) {
                $stm = ociparse($link, $query);
                ociexecute($stm, OCI_DEFAULT);
                while ($data = ocifetchinto($stm, $data, OCI_ASSOC + OCI_RETURN_NULLS)) {
                    $res .= implode('|-|-|-|-|-|', $data) . '|+|+|+|+|+|';
                }
                $res .= '[+][+][+]';
                for ($i = 0; $i < oci_num_fields($stm); $i++) {
                    $res .= oci_field_name($stm, $i) . '[-][-][-]';
                }
                return $res;
            }
            break;
        case 'PostgreSQL':
            if (!function_exists('pg_connect')) {
                return 0;
            }
            $link = pg_connect("host={$host} dbname={$db} user={$user} password={$pass}");
            if ($link) {
                $result = pg_query($link, $query);
                while ($data = pg_fetch_row($result)) {
                    $res .= implode('|-|-|-|-|-|', $data) . '|+|+|+|+|+|';
                }
                $res .= '[+][+][+]';
                for ($i = 0; $i < pg_num_fields($result); $i++) {
                    $res .= pg_field_name($result, $i) . '[-][-][-]';
                }
                pg_close($link);
                return $res;
            }
            break;
    }
    return 0;
}
开发者ID:retanoj,项目名称:webshellSample,代码行数:85,代码来源:a824680ae0452cb5a0bebc0e8bf858f4.php

示例14: columnCount

 /**
  * {@inheritdoc}
  */
 public function columnCount()
 {
     return oci_num_fields($this->_sth);
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:7,代码来源:OCI8Statement.php

示例15: dirname

include dirname(__FILE__) . "/header.php";
include dirname(__FILE__) . '/conectar_ORACLE.php';
$FE_ESTADO_DESDE = $_REQUEST["FE_ESTADO_DESDE"];
$FE_ESTADO_HASTA = $_REQUEST["FE_ESTADO_HASTA"];
if (!empty($FE_ESTADO_DESDE) && !empty($FE_ESTADO_HASTA)) {
    include dirname(__FILE__) . "/queries/query_controlTK.php";
    $query1 = oci_parse($c, $query);
    oci_execute($query1);
    echo "<input type=\"hidden\" value=\"{$FE_ESTADO_DESDE}\" id=\"FE_ESTADO_DESDE\" />\n<input type=\"hidden\" value=\"{$FE_ESTADO_HASTA}\" id=\"FE_ESTADO_HASTA\" />\n<div class='container'>\n\t<div class='sixteen columns'>\n\t\t<div id='page-title'>\n\t\t\t<h2>Control TeleMarketing</h2>\n\t\t\t<div id='bolded-line'></div>\n\t\t</div>\n\t</div>\n</div>\n<div class='container'>\n\t<div class='sixteen columns'>\n\t\t<div class='field'>\n\t\t\t<input type=\"button\" id=\"boton_descargar_control\" onclick=\"controlTK()\" value=\"Descargar Planilla de Control TeleMarketing (Excel)\"/>\n\t\t</div>\n\t</div>\n\t<div class='sixteen columns'>\n\t\t\t<h3>Carga entre el {$FE_ESTADO_DESDE} y el {$FE_ESTADO_HASTA}</h3>\n\t</div>\n</div>\n<div class='container'>";
    $NUM_COL = 0;
    $NUM_HREF = 0;
    echo "<div class='sixteen columns'>";
    echo "<h3><a href=\"controlTK.php\">Volver Atrás</a></h3>";
    echo "<table class='standard-table'>";
    $ncols = oci_num_fields($query1);
    echo "<tr>\n";
    for ($i = 1; $i <= $ncols; ++$i) {
        $colname = oci_field_name($query1, $i);
        echo "  <th><b>" . htmlentities($colname, ENT_QUOTES) . "</b></th>\n";
    }
    echo "<th><b>Ver más</b></th>";
    echo "</tr>\n";
    while ($row = oci_fetch_array($query1, OCI_BOTH + OCI_RETURN_NULLS)) {
        //Genero las columnas dinamicamente
        echo "<tr>";
        while ($NUM_COL < $ncols) {
            if ($NUM_COL == 0) {
                $FLAG = $row[$NUM_COL];
                if (substr($FLAG, 0, 3) == 'Con' || substr($FLAG, 0, 3) == 'Sin') {
                    echo "<td><span class=\"control\">" . $row[$NUM_COL] . "</span></td>";
开发者ID:ezeed,项目名称:CPI,代码行数:30,代码来源:controlTK_datos.php


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