@hb_mulesoftTechworld
In This session you will gain knowledge on how to consume or call Database stored procedure from Mulesoft API's.
Session Content
=============
Second flow to get user details from db using Stored procedure
to get user details from db using Stored procedure with input parameter
Format the db response to understandable json format
to get user details count from db using Stored procedure
with input parameter and coutn outpout parameter
SP1
------
DELIMITER //
CREATE PROCEDURE mysql.GetAllUsers()
BEGIN
SELECT * FROM mysql.user;
END //
DELIMITER ;
call GetAllUsers();
SP2
------
DELIMITER //
CREATE PROCEDURE GetUsersByUpdateAccess(IN p_update_flag varchar(1) )
BEGIN
SELECT * FROM mysql.user where Update_priv = IFNULL(p_update_flag, Update_priv);
END //
DELIMITER ;
call GetUsersByUpdateAccess('Y');
SP3
------
DELIMITER //
CREATE PROCEDURE GetUsersCountByUpdatePriv(IN p_update_flag varchar(1), OUT o_users_count INT)
BEGIN
SELECT COUNT(*) INTO o_users_count FROM mysql.user where Update_priv = IFNULL(p_update_flag, Update_priv);
END //
DELIMITER ;
call GetUsersCountByUpdatePriv('Y',@count);
SELECT @count;