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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure and Prepared Statment

Status
Not open for further replies.

florida1987

IS-IT--Management
Dec 9, 2007
26
For my Oracle SQL as a back end to my web applications I use Prepared Statements alot in my Java Database Connectivy (JDBC) working with Oracle 9i.

I also heard the term Stored Procedure. What is the difference between Stored Procedure and Prepared Statement?
 
I think a prepared statement is just a piece of SQL that has been parsed by Oracle and loaded into the the SGA (shared global area) so that it can be reused with different parameters. A stored procedure is a PL/SQL routine stored in the database. It's not something you can use in a SQL statement. To call it you would have to write some PL/SQL such as:

begin
stored_proc(parameters...);
end;

There are also stored functions which can sometimes be called through SQL.

select myfunc(parameters)
from table

There are also stored packages which group together functions and procedures. Consult the PL/SQL documentation for more details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top