Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
69 views

I have a mysql 8.0 stored procedure which uses a start_date parameter in the logic. If start_date is "set" (e.g., set @start_date = '2023-01-01', the query executes in a fraction of a second....
abawb's user avatar
  • 45
0 votes
0 answers
21 views

I'm testing user defined variable directly in PHPMyAdmin's console. I've observed that if I create: SET @myVariable = 14; I execute it, and then try to use it in another query during the same session:...
Hafid Feghouli's user avatar
-2 votes
1 answer
113 views

First, I set John to the user-defined variable @name as shown below: SET @name = 'John'; Then, I set David to @name in a transaction, then rollbacked as shown below: BEGIN; SET @name = 'David'; ...
Super Kai - Kazuya Ito's user avatar
0 votes
1 answer
6k views

I use the following query in my trigger to store user's ID for further use: SELECT set_config('session.my_username', 'john', false); Later, in other trigger I use it this way: SELECT current_setting('...
MSSI's user avatar
  • 304
555 votes
6 answers
456k views

In another question I posted someone told me that there is a difference between: @variable and: variable in MySQL. He also mentioned how MSSQL has batch scope and MySQL has session scope. Can ...
aarona's user avatar
  • 37.7k