on 2018 Jan 04 3:28 AM
Is it possible to create procedure within another procedure?
create procedure my_creator() begin select * from dummy; create procedure my_procedure() begin select * from dummy; end endThis block is executable and the procedure 'my_creator' is created. When I call this procedue 'my_creator', then the other procedure my_procedure is NOT created.
Could maybe anybody help?
Thanks in advance
It is so, in case the body of any procedure contains a select statement, then the execution of the procedure will be ended once reaching this statement, so this select statement will be the last executed statement within the procedure without throwing any error. Moreover, if this procedure (which contains a select statement) is called within another procedure then the execution of this caller procedure will be stopped as well. Maybe this serves some logic or some intention!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.