Q
Problem solve Get help with specific problems with your technologies, process and projects.

Calling a PL/SQL procedure

How do I call a PL/SQL procedure? Can we call it in an SQL query as we do in SQL Server? What do we have to do to call it outside of Oracle?

Calling a PL/SQL procedure is really a function of your application, just as it is in SQL Server. If I am in SQL*Plus, then I can call any procedure as follows:

 EXEC proc_name;

If I am in a PL/SQL block, I can call the stored procedure as follows:

 proc_name;

It doesn't get any simpler than that!

For some additional examples, let's suppose that my application is a Java Server Page (JSP). Then, I can call a stored procedure with the following JSP code:

 <% CallableStatement cstmtMyProc = ConncstmtMyProc.prepareCall("{call myProc}"); cstmtMyProc.execute(); %>

Hopefully, you've gotten the idea that calling a stored procedure varies depending on the application platform you are using. This is true of any RDBMS engine, including SQL Server and Oracle.

 

For More Information


Dig Deeper on Using Oracle PL-SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close