سؤال

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

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

Something like this can be done though using SLEEP()

SELECT * FROM mytable;

SELECT SLEEP(10);

INSERT INTO mytable (name,surname)
VALUES ('john','john');
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top