Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Event Dynamically

Status
Not open for further replies.

skibum019

IS-IT--Management
Dec 13, 2001
25
US
Anyone know how to create events dynamically. I have a couple of applications I am developing where I would like to be able to setup events dynamically based on user interactions and setups. Is this possible through the MySQL routines or triggers? Can it be accomplished through coding on the page/form that it would be called from?
 
Not quite sure what you are after. Do you want a user action in a web form to run a MySQL procedure, for example? Is it a deliberate 'Do This' UI event, or a side-effect of something else?
 
Preferably I would like to have a routine in MySQL that I can pass variables to which then creates the event based on the variables passed to it.
Simplified Example:
User defines they want a certain event to occur every 6 hrs starting at 1am. Pass the time parameters, the property they were working on, and the routine to run. Build the event based on those parameters passed and the "known" information.
i.e. (Crude example of what I am looking for below)

ROUTINE x (@RoutineToRun,@Var1,@Var2,@Int,@IntType,@Start)
BEGIN
CREATE EVENT e EVERY @Int @IntType STARTS @Start
ON COMPLETION PRESERVE ENABLED
COMMENT 'This event creates a new event every 6 hours
on property x'
BEGIN
DO
CALL @RoutineToRun(@Var1,@Var2)
END
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top