Solved

Call procedure PLSQL

Posted on 2007-03-22
7
1,793 Views
Last Modified: 2012-06-27
How to call PLSQL procedure?
0
Comment
Question by:CliffEngelWirt
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countAbc challenge 9 59
groupSumClump challenge 9 103
Tviruailstringtree sort multi columns on header click 1 54
Not needed 13 95
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This is about my first experience with programming Arduino.
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 …
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now