Solved

Call procedure PLSQL

Posted on 2007-03-22
7
1,799 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 250 total points
ID: 18773784
> exec(ute) procedure(parameters);
0
 
LVL 8

Assisted Solution

by:nedfine
nedfine earned 250 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 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