Call procedure PLSQL

Posted on 2007-03-22
Last Modified: 2012-06-27
How to call PLSQL procedure?
Question by:CliffEngelWirt
  • 2
  • 2
LVL 20

Accepted Solution

gatorvip earned 250 total points
ID: 18773784
> exec(ute) procedure(parameters);

Assisted Solution

nedfine earned 250 total points
ID: 18778693
To call a procedure within a PL/SQL block as an executable statement:

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


Author Comment

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

In my calling procedure, can I call like this?

LVL 20

Expert Comment

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

Author Comment

ID: 18789589
Thank you.

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add mobile access to browser application 3 133
Sql how to exclude from a table 3 73
word0 challenge 3 58
move one pixel 4 41
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

9 Experts available now in Live!

Get 1:1 Help Now