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;








-1















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










share|improve this question





















  • 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















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










share|improve this question





















  • 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








-1








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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












1 Answer
1






active

oldest

votes


















1
















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;





share|improve this answer
























    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
    );



    );














    draft saved

    draft discarded
















    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









    1
















    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;





    share|improve this answer





























      1
















      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;





      share|improve this answer



























        1














        1










        1









        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;





        share|improve this answer













        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;






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 8:11









        AleksejAleksej

        19.4k5 gold badges23 silver badges35 bronze badges




        19.4k5 gold badges23 silver badges35 bronze badges





















            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.




















            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

            밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

            1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴