PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ora_fetch_into> <ora_errorcode
Last updated: Sun, 25 Nov 2007

view this page in

ora_exec

(PHP 4, PHP 5 <= 5.0.5)

ora_exec — Execute a parsed statement on an Oracle cursor

설명

bool ora_exec ( resource $cursor )

Executes the parsed statement cursor .

매개변수

cursor

An Oracle cursor, already parsed by ora_parse().

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다. Details about the error can be retrieved using the ora_error() and ora_errorcode() functions.

변경 기록

버전 설명
5.1.0

oracle 확장은 권장되지 않습니다. oci8를 사용하십시오.

주의

권장되지 않는 oracle을 대신하여 oci8를 사용할 때는 다음을 고려하십시오:



add a note add a note User Contributed Notes
ora_exec
cjbj at hotmail dot com
06-Jan-2004 08:11
If you are using bind variables and get the error:

"Warning: Can't find variable for parameter in myfile.php on line X"

where line X is the ora_exec() call, you may need to set the bound PHP
variable to something before calling ora_exec().  See the ora_bind()
user comments for the working example I added.
kerxen at caramail dot com
23-May-2003 04:13
Maybe newbies don't know in which order to use all the ORA_FUNCTIONS.

Here is a function to execute queries. But it is not made for SELECT queries, because the cursor is closed at the end but you can adapt it.

Moreover, you need to logon and logoff (obviously)...
 
SYNOPTIC :
   $conn = ora_logon  ("user@TNSNAME", "pass");
   $query="";
   execute_query ($query,$conn);
   ora_logoff ( $conn) ;

/*-------------------
Here is the execute_query function
-------------------*/

function execute_query ($query,$conn){
   // ouveture du curseur , create a cursor
     if (!($cursor= ora_open($conn)))
     {  reportError ($conn, " Cursor could not be opened! ");
        exit;        // Termine le script courant , end the script
     }
   // parse query  // analyse la requete et l'associe au curseur, analyse the query and use the cursor for it
     if (!ora_parse ($cursor, $query))
     {  reportError ($cursor, " Statement could not be parsed! ");
        exit;
     }
   // execution de la query, execution of the query
     if (!ora_exec($cursor))
     {  reportError ($cursor, " Statement could not be executed! ");
        exit;
                                            }
   // ferme le curseur oracle, close the cursor
     ora_close($cursor);
   // valide la transaction, validation of the transaction (if any)
     ora_commit($conn);
     }

/*-------------------
Here is the reportError function.
-------------------*/

    function reportError($code,$message ="")
    {   print ("$message\n");
         print ("Code Erreur: " . ora_errorcode($code) . "\n");
        print ("Message d'Erreur: " . ora_error($code) . "\n");
    }

Good Luck !
Eddy Cingala

ora_fetch_into> <ora_errorcode
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites