If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > triggers in mysql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-08, 09:43
srinathbtech srinathbtech is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
triggers in mysql

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

thanks
sri
Reply With Quote
  #2 (permalink)  
Old 10-06-08, 09:47
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 10-07-08, 02:27
srinathbtech srinathbtech is offline
Registered User
 
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 !!
Reply With Quote
  #4 (permalink)  
Old 10-07-08, 02:43
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
wonder if Google knows anything?
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 10-07-08, 02:46
BargainPredator BargainPredator is offline
Registered User
 
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);
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On