Call Stored Procedure from Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akashazad
    New Member
    • Sep 2007
    • 38

    Call Stored Procedure from Function

    Hi Friends
    My question is "can we call Stored Procedure from a User Defined Function in SQL"

    If yes then pl tell me how?

    If No then pl tell me why not ?

    While I was trying finding about the this question on internet I m getting both kind of answers hence I am confused .

    Pl help,Thanx in advance
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    Sure you can. You just call it like you would from anywhere else.
    [code=php]CALL `myProcedure`(' parameter1', 'etc...');[/code]

    There are some limitations to how procedures can be called from Triggers, though. (See the manual for details on what those are exactly.)

    Comment

    • akashazad
      New Member
      • Sep 2007
      • 38

      #3
      Originally posted by Atli
      Hey.

      Sure you can. You just call it like you would from anywhere else.
      [code=php]CALL `myProcedure`(' parameter1', 'etc...');[/code]

      There are some limitations to how procedures can be called from Triggers, though. (See the manual for details on what those are exactly.)
      Hey Atil
      Thanx for the reply

      but can you just explain it a bit more because I am not getting it properly

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        There isn't much to explain, really. Calling a stored procedure from within a user function is exactly like calling a procedure by itself... You just issue a CALL command where you want the procedure to be called.

        If that isn't making sense, you may want to brush up on the way functions work.

        Comment

        Working...