Question

I would execute a SQL query like this :

INSERT INTO mytable (name,surname)
VALUES ('john','john')

But just one time after 10 seconds for example.

Somethings like this :

CREATE 
ON SCHEDULE AFTER 10 seconds
INSERT INTO mytable (name,surname)
VALUES ('john','john')

I'm waiting for your answers

Was it helpful?

Solution

Try this, for more information about creating events in mysql.

http://dev.mysql.com/doc/refman/5.1/en/events-overview.html

CREATE EVENT DO_INSERT_OP
ON SCHEDULE
AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
DO INSERT INTO mytable (name,surname)
VALUES ('john','john');

OTHER TIPS

Something like this can be done though using SLEEP()

SELECT * FROM mytable;

SELECT SLEEP(10);

INSERT INTO mytable (name,surname)
VALUES ('john','john');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top