Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Call procedure PLSQL

Posted on 2007-03-22
7
Medium Priority
?
1,803 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Progress

636 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