I have this stored procedure. How can I select a variable as a field that can +1 value in every row of results of sp? I need it for making a virtual id field. please help me. CREATE DEFINER=`root`@`…
Tag: stored-procedures
sql query hangs/times out when passed large data
UPDATED: Guys I am passing list of faculty id’s to stored procedure, when i pass more than 10 faculty id’s it’s taking long time to process the data and sometime times out. I spent good amount of time …
How to save SQL query analytics in the background while still delivering records to user?
I am interested in knowing if there is an efficient way to record the analytics from a SQL query while still providing the records to the requester? I’m currently on MS SQL Server 2012. Let’s say for …
Displaying student absent dates
Here is the table I want to display: Now I want to search by from to date and want absent date. How can I achieve this? I tried below code: i want date for which student absend Answer Basically what you need is list of possible dates between From and To
Stored procedure runs correctly only sometimes
My problem is: I have a stored procedure that only sometimes runs correctly, sometimes it does not run at all and sometimes partially (some rows where inserted in the table bot not all). I use lazarus …
Duplicate or same record in select query
I tried to execute a select query which I select from the different tables but I still getting duplicate record even I use “DISTINCT”. Below I attached the result from my query. Answer DE_Name is different between 2 rows. So it’s correct. To resolve your problem, just do it However, the root causes problem is you just need to select
MySql Trigger for notification
In a table in MySql database, I have a boolean column with ‘Yes’ and ‘No’ for appointment confirmation. As soon as appointment gets ‘Yes’, a notification is sent via an AWS Lambda call. I want to send a 12 hour prior notification before the day of the appointment. What is the best way to do that in My Sql utilizing
selecting a variable string name in sql select query in case of stored procedures
Suppose I want to select a constant value in an sql query, I could do something like this : select name,age,’tick’ from tableA I want to dynamically generating an sql query using stored procedures. …
Store procedures for delete a repeat records
Hello i have a table in MySQL: “contracts” where i create a 3 record’s for each client_id, but one bug in the backend create more records on some client_id i try create a store procedure to …
Pass a table variable using table type into a stored procedure?
I have a table employee with around 1000 entries, I have to create a stored procedure which accepts a parameter. The parameter will most likely be of the type which I created ‘AS Table’. Upon passing …