All Questions
Tagged with mysql stored-procedures
6,799
questions
0
votes
1
answer
20
views
How to use PREPARE and EXECUTE in Stored Procedure backup script (MySQL)
I have a Stored Procedure which loops through all the tables in a schema (customerinfo) and makes a backup of them by renaming them to include the date and copying them to another schema (...
0
votes
0
answers
24
views
Error Code 1329 when attempting nested Loops in MYSQL 8 [duplicate]
I am working on a stored procedure and I have a rather complicated set of instructions in this query. (I apologize for the odd variable names, I had to mask data)
I have delcared a variable varId and ...
0
votes
1
answer
37
views
Rollback Transaction in Mysql Query
DELIMITER ;;
CREATE DEFINER=root@localhost PROCEDURE ExecuteDataFill(IN p_internalCompanyId INT)
BEGIN
DECLARE u_cursor CURSOR FOR
SELECT name, address, area, pincode, city, state, ...
0
votes
0
answers
11
views
Can I set an email to send when the status in the database changes in MySQL versions 5.6 or 5.7? [duplicate]
Can I set up email notifications to send when the status in the database changes in MySQL versions 5.6 and 5.7? I am trying to send emails directly through the database without using any cron jobs. ...
0
votes
1
answer
50
views
Can't reopen table: 'lc1' in mysql
Please check my SP Below in mysql:
DELIMITER $$
CREATE PROCEDURE usp_calculate_license_fees()
BEGIN
DECLARE totalRowCount INT;
SET SQL_SAFE_UPDATES = 0;
-- Step 1: Create ...
0
votes
1
answer
77
views
Problems with MySQL stored procedure
I am trying to compile the following (see below) MySQL stored procedure and I keep getting Error Code 1064.
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL ...
0
votes
1
answer
30
views
MySQL stored procedure error with two cursors in the same routine "ER_SP_CURSOR_NOT_OPEN: Cursor is not open"
In this stored procedure for an inventory system I want to process a packaging order for a product in kg according to the type of container and its capacity in kg.
This finally stores the existence of ...
0
votes
1
answer
35
views
Declaring 2 Cursors in a Stored Procedure | SQL Error [1338] [42000]: Cursor declaration after handler declaration
I'm trying to declare two Cursors in a stored procedure but it shows
"SQL Error [1338] [42000]: Cursor declaration after handler declaration
Cursor declaration after handler declaration
Cursor ...
0
votes
2
answers
57
views
Read query locking the insertion of a new record on a table with error - Lock wait timeout exceeded; try restarting transaction
I have a stored procedure that runs every one hour to generate a summary of the transactions that happened in the service. The stored procedure reads the data from a table called transaction_log and ...
-1
votes
0
answers
26
views
trying to pass in a value to a regex expression in a mysql store procedure [duplicate]
I have this SQL query that works perfect:
SELECT * FROM VEHICLE_TEST WHERE Model REGEXP '[[:<:]]F150[[:>:]]' AND `Type` = 'Truck';
I am trying to create a store procedure for this to pass in ...
0
votes
1
answer
40
views
Working with ASP.NET Core 6 and mysql server, is there a way to know the status of a stored procedure?
Currently I'm working on ASP.NET Core 6 and with a Mysql server. I'm working on functionality where frontend calls to us to, then, call a stored procedure which should disable this functionality (aka ...
0
votes
3
answers
52
views
Executing stored procedure delete all rows from table despite WHERE clause setting
I created this little stored procedure that deletes a row from my 'qrcode' table.
Due to the constraint, I update all child rows before, it works fine.
However, performing this procedure....deletes ...
0
votes
0
answers
33
views
Insights on Procedure in mySQL
I am trying to define a procedure that should run at midnight everyday.
CREATE PROCEDURE name
BEGIN
do something ;
do something 2 ;
do something 3 ;
END
I understand the need for delimiter in ...
0
votes
1
answer
76
views
How to search for FirstName, MiddleName and LastName in MySql
I have a stored procedure that is used for customer search.
Curently I am having issues geeting search results when the MiddleName is ommitted.
Below is a breakdown of the error
if a customer name ...
2
votes
0
answers
51
views
Search and filter with multiple tables
I want to search and filter from multiple tables with search term as input from user
I have tables like
Profiles
id first_name last_name middle_name gender life_status lds_number status
1 ...