GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Execute shell script through stored procedure

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ;

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

    Comment

    Working...
    X