★ wanayoo — archive 1999 http://www.php.net/manual/function.ociparse.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to OCI8
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
OCI8
* OCIDefineByName
* OCIBindByName
* OCILogon
* OCIPLogon
* OCINLogon
* OCILogOff
* OCIExecute
* OCICommit
* OCIRollback
* OCINewDescriptor
* OCIRowCount
* OCINumCols
* OCIResult
* OCIFetch
* OCIFetchInto
* OCIFetchStatement
* OCIColumnIsNULL
* OCIColumnSize
* OCIServerVersion
* OCIStatementType
* OCINewCursor
* OCIFreeStatement
* OCIFreeCursor
* OCIColumnName
* OCIColumnType
* OCIParse
* OCIError
* OCIInternalDebug
Manual: OCIParse
View the source code for this pageSearch the site



Previous page
 OCIColumnType
 Updated
Sat, 12 Aug 2000
OCIError 
Next page


OCIParse

(unknown)

OCIParse -- Parse a query and return a statement

Description

int OCIParse (int conn, strint query)

OCIParse() parses the query using conn. It returns the statement identity if the query is valid, false if not. The query can be any valid SQL statement.


User Contributed Notes: OCIParse


jeremy@progressrail.com
20-Sep-1999 12:04
Anybody know of a way to pass in parameters to your sql statement, and then parse the statement with it expecting the parameters. This ability will give a big boost on the oracle side if it can be done. In perl (DBI interface to Ora) you just put a '?' where the value will be, and the execute statement holds params.


example:

(from memory, so flame somebody else)
<pre>
-----------8<------------------
$sql = "select blah from blip where blah = ? and blah2 = ?";
$st = $db->prepare($sql);
$st->execute($val1, $val2)
<pre>
-----------8<------------------

i hope php does this. i would much rather use it to talk the Oracle database than perl. (not that perl is bad. again, no flames please.)

please email me if anybody knows how to do this. not sure if this is even the place for this.



herbert@widesoft.com.br
08-Oct-1999 09:30
Don't forget that the queries on PHP DON'T use the semicolon at the end of the SQL command.
Putting a semicollon at the end will give a "Invalid Character" error.



waltb@rocketcash.com
27-Oct-1999 10:28
Does anyone know how to call a stored procedure from php to Oracle?


webmaster@remoterealty.com
01-Nov-1999 01:47
$sth = OCIParse ( $dbh, "begin sp_newaddress( :address_id, '$firstname', '$lastname', '$company', '$address1', '$address2', '$city', '$state', '$postalcode', '$country', :error_code );end;" );

This calls stored procedure sp_newaddress, with :address_id being an in/out variable and :error_code being an out variable. Then you do the binding:

OCIBindByName ( $sth, ":address_id", $addr_id, 10 );
OCIBindByName ( $sth, ":error_code", $errorcode, 10 );
OCIExecute ( $sth );

Hope this helps!



k_a_h_l_i_l@yahoo.com
12-Dec-1999 05:30
Is it just me, or does ociparse always return TRUE?


rouvas@di.uoa.gr
18-Jan-2000 03:25
About calling stored procedures. Why do you need to do 'begin stored_procedure(blah,blah,blah'? Can't you do 'select stored_proc(...) from dual';


dboyd@cal.montage.ca
09-Mar-2000 11:15
If OCIParse returns true or false, then why does this work...


<PRE>
$stmt = OCIParse($conn,$query);
OCIExecute($stmt,OCI_DEFAULT);
</PRE>
Shouldn't $stmt be either true or false, and probably not be statement handle as OCIExecute expects?


Or does OCIParse return a statement handle, and zero on error?




frithjof@nikocity.de
24-Mar-2000 01:28
About OCIParse Description: true / false - OCIParse returns a statement handle.

But if OCIExecute gets a statement handle as a result of a wrong sql-query parsed by OCIParse() - ORACLE returns an Error.

You can view these error messages by turning on error_reporting in php.ini.



 About Notes


Previous page
 OCIColumnType
 Updated
Sat, 12 Aug 2000
OCIError 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.