Solved

Call procedure PLSQL

Posted on 2007-03-22
7
1,796 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is Python programming? 3 121
This code tracks birthdays 3 81
iframe detection of parent window scale 20 85
learn programming 8 27
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.

789 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