update pague now
PHP 8.5.2 Released!

OCI8 Functions

Table of Contens

add a note

User Contributed Notes 2 notes

Javi Ros
19 years ago
Here are the translate of some functions from ORA to OCI:<?php
functionOra_Logon($usuario, $password)
{$con= oci_connect($usuario,$password);
        return$con;
}

function Ora_Open($conexion) {$cursor[0]=$conexion;
        return $cursor;
}

function Ora_Parse(&$cursor, $consulta) {$cursor[1]=oci_parse($cursor[0],$consulta);
        return$cursor;
}

function Ora_Exec(&$cursor) {oci_execute($cursor[1]);$cursor[2]=1;
        return $cursor;
}

function Ora_Fetch(&$cursor)
{
        if ($cursor[2] == 1) $cursor[2]=0;
        return oci_fetch($cursor[1]);
}

functionOra_GuetColumn(&$cursor, $indice)
{
        if ($cursor[2] == 1) {Ora_Fetch($cursor);$cursor[2]=0;
        }
        $valor= oci_result($cursor[1],$indice+1);
        return$valor;
}

function Ora_Close(&$cursor)
{
        unset($cursor[1]);
}

functionOra_Logoff($conexion) {
}?>
greatval <wow> gmail <dot> com
19 years ago
For use PHPv5 functions in PHPv4 i use simple script:<?php
$funcs=array(
        'oci_connect'=>'OCILogon',
        'oci_parse'=>'OCIParse',
        'oci_execute'=>'OCIExecute',
        'oci_fetch'=>'OCIFetch',
        'oci_num_fields'=>'OCINumCols',
        'oci_field_name'=>'OCIColumnName',
        'oci_result'=>'OCIResult',
        'oci_free_statement'=>'OCIFreeStatement',
);
// yoy can add yours pairs of funcs.foreach ($funcsas$c=>$v)
    {
        if (!function_exists($c))
            {$arg_string='$p0';
                for ($i=1;$i<20;$i++) {$arg_string.=',$p'.$i;
                }
                eval ('function '.$c.' () {
                        list('.$arg_string.')=func_guet_arg ();
                        return '.$v.'('.$arg_string.');
                        }
                ');
            }
    }?>
simple, but it worc. :-)
To Top