Execute shell script through stored procedure

Hi ,

I want to execute shell script through stored procedure if condition matches

DELIMITER $$
CREATE PROCEDURE CheckStatus()
BEGIN
DECLARE state INT DEFAULT 0;
select count(*) into state from test_done where status=0 or status=‘’;
IF state=0
THEN
SELECT state;
ELSE
sh /usr/bin/testshell.sh
END IF;
END $$
DELIMITER ;

Can’t do it. Not unless you use a UDF. Search Google, there might be a system() UDF.