Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Unanswered: triggers in mysql

    hi,
    i am newbie to mysql triggers,
    can any one help me how to create/call trigger from application

    thanks
    sri

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Triggers cannot be called from an application (per s&#233.
    Triggers are set to execute on INSERT, UPDATE and DELETE events on the specified object they are created for.

    Perhaps you are thinking of Stored Procedures / Functions?
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Quote Originally Posted by georgev
    Triggers cannot be called from an application (per sé).
    Triggers are set to execute on INSERT, UPDATE and DELETE events on the specified object they are created for.

    Perhaps you are thinking of Stored Procedures / Functions?
    hi ,
    yes you are right , i was pondering on how to call/create procedures/functions

    help me !!

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    wonder if Google knows anything?
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Sep 2008
    Posts
    8
    Create a procedure :
    Code:
    DELIMITER $
    
    CREATE PROCEDURE aProcdure(aInput INT)
    BEGIN
    
        IF aInput = 4 THEN
            ...
        ELSE
            ....
        END IF;
    
    END$
    
    DELIMITER ;
    CAll a procedure :

    Code:
    CALL aProcdure(1);
    Create a function :

    Code:
    DELIMITER $
    
    CREATE FUNCTION aFunction(aInput INT) RETURNS INT
    BEGIN
        DECLARE aValue INT; 
        ...
        
        RETURN aValue;
    END$
    
    DELIMITER ;
    Call a function :

    Code:
    SELECT aFunction(1);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •