Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP code vs Stored Procedures

Status
Not open for further replies.

joseomar

Programmer
Feb 13, 2002
7
0
0
SI
Hi,

I have a couple of questions related to the use of oracle stored procedures from PHP.

First. Is it simple to call Oracle stored procedures from PHP. What is the best way of doing it? How are results passed back to PHP? Any examples out there?

Second. Are there any performance issues when calling stored procedures from PHP? or am I better off doing all the inserts/deletes/updates straight from PHP?

Your help is much appreciated.

Jose
 
well, i use oracle but i don't use much procedures.

What i can tell you by my experience with other databases, you should use SP's when you need to do several operations in a row. This way, you only send one command to the Oracle and you only get one Result. This way is faster. But, as i told you before, i don't use much SP's in oracle, only in SQL Server. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
To run a stored procedure you just use the query command but use "exec stored_procedure @param = 'parameters'"

Be sure to make sure text is converted to safe SQL text (' and " are annoying).

Stored procedures are faster than PHP because they work closer the data and within the SQL interpreter.

PHP has to make many calls to do simple data manipulation, SQL SPs are fast! --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top