sql - mysql calling another procedure(of another schema) from procedure -


i want call sp1 sp2. sp1 stored in database schema on same pc. please check following snippet

    create definer=`root`@`localhost`  procedure `db2`.`sp2_procedure` () begin     call sp1_procedure(50); end 

also tried call db1.sp1_procedure(50); calling wrongly or calling sp of other schema not possible

note :: sp - stored procedure.

you can simply, mention schema name in prefix.

for instance :

create definer=`root`@`localhost` procedure `db1`.`sp1`() begin select 'i procedure db'; end 

next,

create definer=`root`@`localhost` procedure `db2`.`sp2`() begin call db1.sp1(); end 

and call :

use db2; call `db2`.sp2(); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -