Pregunta

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

¿Fue útil?

Solución

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');

Otros consejos

Something like this can be done though using SLEEP()

SELECT * FROM mytable;

SELECT SLEEP(10);

INSERT INTO mytable (name,surname)
VALUES ('john','john');
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top