?
Solved

Call procedure PLSQL

Posted on 2007-03-22
7
Medium Priority
?
1,802 Views
Last Modified: 2012-06-27
How to call PLSQL procedure?
0
Comment
Question by:CliffEngelWirt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 20

Accepted Solution

by:
gatorvip earned 1000 total points
ID: 18773784
> exec(ute) procedure(parameters);
0
 
LVL 8

Assisted Solution

by:nedfine
nedfine earned 1000 total points
ID: 18778693
To call a procedure within a PL/SQL block as an executable statement:
procedure_name(arguments);

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, ..)



0
 

Author Comment

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

In my calling procedure, can I call like this?

BEGIN
.
.
.
ABC(URL);
.
.
.
end;
0
 
LVL 20

Expert Comment

by:gatorvip
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
0
 

Author Comment

by:CliffEngelWirt
ID: 18789589
Thank you.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans
Suggested Courses

752 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