Questions tagged [mysql-routines]

20 questions
60
votes
4 answers

How to schedule a stored procedure in MySQL

I have this stored procedure. How can I run this for example with intervals of 5 seconds? Like a routine for eliminate data with a time-stamp older than one day? DROP PROCEDURE IF EXISTS `delete_rows_links` GO CREATE PROCEDURE…
user455318
  • 3,280
  • 12
  • 41
  • 66
59
votes
9 answers

Mysql Event Not Working

I have added the following simple test event on my mysql database via phpmyadmin: CREATE DEFINER=`root`@`localhost` EVENT `my_event` ON SCHEDULE EVERY 1 MINUTE STARTS '2013-05-27 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN UPDATE…
Rana
  • 5,912
  • 12
  • 58
  • 91
6
votes
4 answers

PHPMyAdmin: You might be lacking the necessary privileges to edit this routine

Error in processing request: No routine with name 'daily_difference' found in database 'chamelis_wp'. You might be lacking the necessary privileges to edit this routine.
Tasnim Khan
  • 207
  • 3
  • 12
4
votes
3 answers

mysql - create event in store procedure

How to create event inside store procedure? This is what I been trying to do, and it tells me that I have a syntax error, only it doesn't tells me where. -- -------------------------------------------------------------------------------- -- Routine…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
3
votes
1 answer

Advantages/disadvantages of using MySQL triggers

What are the advantages/disadvantages of using MySQL triggers to keep data synced between one table and another and even update aggregate/report tables as data changes? By aggregate/report tables I mean tables that summarise data that exists in…
3
votes
2 answers

MySQL and PDO, speed up query and get result/output from MySQL function (routine)?

Getting the Value: I've got the levenshtein_ratio function, from here, queued up in my MySQL database. I run it in the following way: $stmt = $db->prepare("SELECT r_id, val FROM table WHERE levenshtein_ratio(:input, someval) > 70"); …
Birrel
  • 4,754
  • 6
  • 38
  • 74
2
votes
1 answer

Call to MySQL user defined function in CakePHP 3

I'm working on cakePHP 3. I have a user defined function(UDF or Routine) in mysql database. That function takes two parameters and returns an integer value. I have to match that returned value in MySQL where clause. I know mysql query to use that…
Akshay Vaghasiya
  • 1,597
  • 9
  • 36
  • 60
1
vote
1 answer

Mysql Error Delimiter: Error at Line Delimiter

I am trying to use a mysql function that I have found but I seem to be getting some errors with this. Here is the function: SET GLOBAL log_bin_trust_function_creators=1; DROP FUNCTION IF EXISTS digits; DELIMITER $$ CREATE FUNCTION digits( str…
The Humble Rat
  • 4,586
  • 6
  • 39
  • 73
1
vote
2 answers

How can I grant to the limited users to see the structure of mysql routines?

How can I grant somebody to see the structure of mysql routines? The following command can be used to show the structure of routines: show create function FUNCTION_NAME or show create procedure PROCEDURE_NAME but It should be run by the user with…
Omidreza Bagheri
  • 781
  • 1
  • 11
  • 22
0
votes
0 answers

Declare Function in MySQL for MySQL Version 5.7.19-0ubuntu0.16.04.1

My Situation I am hosting a PHP Backend for an App with MySQL Database. I am not happy with my actual hoster, so I want to switch to AWS. I have set up an ec2 instance with lamp and everythings working fine, without my MySQL procedures. I have…
0
votes
1 answer

Mysql Function Deterministic Error

I am using the below function to split a string. I am getting the following error when I try to create the function on my live database: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is…
user3525290
  • 1,557
  • 2
  • 20
  • 47
0
votes
1 answer

MySQL Calling A Stored Procedure Error

I am really hoping someone can help me out. I had a SQL Server 2014 database which I used for a desktop application I wrote. After having to expand, I want to convert to MySQL to access the database over the internet. I user MySQL WorkBench…
GoodDisplayName
  • 68
  • 1
  • 14
0
votes
1 answer

MySQL: Tables vs Views vs Routines

What is the difference Between MySQL : Tables vs Views vs Routines(Store Procedures)? I am familiar with tables. heard about views and routines . for both name itself says , it can allow to view data's is it? In MySQL I am having these 3 under…
Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118
0
votes
1 answer

Extract SELECT expression using MySQL function or procedure

I'm interested in simplifying an SQL query/view by extracting the select expression (select_expr from the MySQL docs). Each of the select_expr is essentially duplicated with a small amount of variation that could be extracted into variables. For…
wsams
  • 2,499
  • 7
  • 40
  • 51
0
votes
1 answer

Procedure is not working

I have written below store procedure to delete users from different tables. But somehow it is not working. If I keep individual query inside the procedure it is working, but if I add more then one it is not working. DELIMITER $$ CREATE…
Suresh Kamrushi
  • 15,627
  • 13
  • 75
  • 90
1
2