Call procedure PLSQL

Posted on 2007-03-22
Last Modified: 2012-06-27
How to call PLSQL procedure?
Question by:CliffEngelWirt
  • 2
  • 2
LVL 20

Accepted Solution

gatorvip earned 250 total points
ID: 18773784
> exec(ute) procedure(parameters);

Assisted Solution

nedfine earned 250 total points
ID: 18778693
To call a procedure within a PL/SQL block as an executable statement:

E.g. apply_discount(new_company_id, 0.15);
display_store_summary; -- no parenthesis needed

Calling Stored Procedures at SQL*Plus prompt

Procedures or Functions are normally called within executable or exception-handling section. However, we can call a stored procedure at SQL*PLUS prompt with EXECUTE command as follow:

EXECUTE procedure_name(arg1, arg2, ..)


Author Comment

ID: 18786117
If I have a procedure like this..
p_mode  IN varchar2(90),
p_page_URL IN varchar2(200)

In my calling procedure, can I call like this?

LVL 20

Expert Comment

ID: 18786943
Not exactly, because the way you define procedure abc requires 2 parameters, and with abc(URL) you're only supplying one. So you have three options:

1. make p_mode a variable inside abc(), and leave p_page_url as the only parameter
2. give a default value for the first parameter, like so:
procedure abc( p_mode  varchar2(90) default 'a', p_page_URL varchar2(200))
and then you can call it with abc(p_page_URL => URL);
but really, if you don't use p_mode as a parameter you should declare it as a local variable within abc()
3. call abc with 2 parameters, not one

this works on Oracle, so your database may be a little different. But the idea is the same

Author Comment

ID: 18789589
Thank you.

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question