Calling different procedures from a procedure based on input valueSQL Server: Query fast, but slow from procedureInsert results of a stored procedure into a temporary tableCalling stored procedure with return valueGet the calling package/procedure in OracleOracle procedure call fails from jdbcProcedure to input number and output varchar2Return an array of values from a procedure in PL/SQLUsing an out parameter from an execute immediate statement that calls a procedureStored procedure not returning the expected valuecall a plsql procedure from C# to generate a dataset
Why is the the worst case for this function O(n*n)
Contractor cut joist hangers to make them fit
Lost & Found Mobile Telepone
Aftermarket seats
Yet another calculator problem
When calculating averages, why can we treat exploding die as if they're independent?
If every star in the universe except the Sun were destroyed, would we die?
What's the biggest difference between these two photos?
I need to know information from an old German birth certificate
What makes things real?
Why can linguists decide which use of language is correct and which is not?
LGPL HDL in larger FPGA design
How invisible hand adjusts stock prices if company is listed on multiple exchanges, under multiple currencies, and one of the currencies plunges?
Why can't some airports handle heavy aircraft while others do it easily (same runway length)?
The meaning of "offing" in "an agreement in the offing"
How can Schrödinger's cat be both dead and alive?
Owner keeps cutting corners and poaching workers for his other company
What happens when a file that is 100% paged in to the page cache gets modified by another process
Are there any space probes or landers which regained communication after being lost?
How should Thaumaturgy's "three times as loud as normal" be interpreted?
How strong is aircraft-grade spruce?
What can we do about our 9-month-old putting fingers down his throat?
What is this sticking out of my wall?
Is mountain bike good for long distances?
Calling different procedures from a procedure based on input value
SQL Server: Query fast, but slow from procedureInsert results of a stored procedure into a temporary tableCalling stored procedure with return valueGet the calling package/procedure in OracleOracle procedure call fails from jdbcProcedure to input number and output varchar2Return an array of values from a procedure in PL/SQLUsing an out parameter from an execute immediate statement that calls a procedureStored procedure not returning the expected valuecall a plsql procedure from C# to generate a dataset
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to write a procedure which should be able to call different procedures based on the input value.
Example:
calling_proc(inp1, inp2, inp3)
begin
if inp3 = 1 then
exec called_proc_1(inp1, inp2)
end;
if inp3 = 2 then
exec called_proc_2(inp1, inp2)
end;
end;
The inputs for all the called procedures are same. Only the last input tells me which one to execute
oracle stored-procedures plsql
add a comment |
I'm trying to write a procedure which should be able to call different procedures based on the input value.
Example:
calling_proc(inp1, inp2, inp3)
begin
if inp3 = 1 then
exec called_proc_1(inp1, inp2)
end;
if inp3 = 2 then
exec called_proc_2(inp1, inp2)
end;
end;
The inputs for all the called procedures are same. Only the last input tells me which one to execute
oracle stored-procedures plsql
1
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
(Just in case it's the problem)exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.
– APC
Mar 28 at 9:14
add a comment |
I'm trying to write a procedure which should be able to call different procedures based on the input value.
Example:
calling_proc(inp1, inp2, inp3)
begin
if inp3 = 1 then
exec called_proc_1(inp1, inp2)
end;
if inp3 = 2 then
exec called_proc_2(inp1, inp2)
end;
end;
The inputs for all the called procedures are same. Only the last input tells me which one to execute
oracle stored-procedures plsql
I'm trying to write a procedure which should be able to call different procedures based on the input value.
Example:
calling_proc(inp1, inp2, inp3)
begin
if inp3 = 1 then
exec called_proc_1(inp1, inp2)
end;
if inp3 = 2 then
exec called_proc_2(inp1, inp2)
end;
end;
The inputs for all the called procedures are same. Only the last input tells me which one to execute
oracle stored-procedures plsql
oracle stored-procedures plsql
edited Mar 28 at 8:38
Pavel Smirnov
3,3523 gold badges9 silver badges22 bronze badges
3,3523 gold badges9 silver badges22 bronze badges
asked Mar 28 at 7:33
Yaswanth ViswanathYaswanth Viswanath
311 silver badge6 bronze badges
311 silver badge6 bronze badges
1
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
(Just in case it's the problem)exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.
– APC
Mar 28 at 9:14
add a comment |
1
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
(Just in case it's the problem)exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.
– APC
Mar 28 at 9:14
1
1
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
(Just in case it's the problem)
exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.– APC
Mar 28 at 9:14
(Just in case it's the problem)
exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.– APC
Mar 28 at 9:14
add a comment |
1 Answer
1
active
oldest
votes
For example:
create or replace procedure proc0(inp1 in number, inp2 in number, inp3 in number) is
begin
case inp3
when 1 then
proc1(inp1, inp2);
when 2 then
proc2(inp1, inp2);
.
.
.
else ...
end case;
end;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392276%2fcalling-different-procedures-from-a-procedure-based-on-input-value%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For example:
create or replace procedure proc0(inp1 in number, inp2 in number, inp3 in number) is
begin
case inp3
when 1 then
proc1(inp1, inp2);
when 2 then
proc2(inp1, inp2);
.
.
.
else ...
end case;
end;
add a comment |
For example:
create or replace procedure proc0(inp1 in number, inp2 in number, inp3 in number) is
begin
case inp3
when 1 then
proc1(inp1, inp2);
when 2 then
proc2(inp1, inp2);
.
.
.
else ...
end case;
end;
add a comment |
For example:
create or replace procedure proc0(inp1 in number, inp2 in number, inp3 in number) is
begin
case inp3
when 1 then
proc1(inp1, inp2);
when 2 then
proc2(inp1, inp2);
.
.
.
else ...
end case;
end;
For example:
create or replace procedure proc0(inp1 in number, inp2 in number, inp3 in number) is
begin
case inp3
when 1 then
proc1(inp1, inp2);
when 2 then
proc2(inp1, inp2);
.
.
.
else ...
end case;
end;
answered Mar 28 at 8:11
AleksejAleksej
19.4k5 gold badges23 silver badges35 bronze badges
19.4k5 gold badges23 silver badges35 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392276%2fcalling-different-procedures-from-a-procedure-based-on-input-value%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
And... what's your question?
– Pavel Smirnov
Mar 28 at 7:53
Did you write some code? Please post it and tell us what's the issue with it
– Aleksej
Mar 28 at 8:04
(Just in case it's the problem)
exec
is a SQL*Plus command and is not required - in fact is invalid syntax - in PL/SQL, including anonymous blocks.– APC
Mar 28 at 9:14