'How to determine if sql script is executed parallel or not?
I am wondering if this sql is going to execute in parallel or not? This is going to be a new sql stored procedure, which will call other three procedures. I want every procedure to start when the previous one has completed.
BEGIN
IF (new_times_flag = TRUE) THEN
CALL PROCEDURE1(dateFor);
ELSE
UPDATE kt_zones_timeslots_settings SET date_for = dateFor WHERE date_for = oldDateFor;
END IF;
CALL PROCEDURE2(dateFor);
CALL PROCEDURE3(dateFor);
END
I have read how does sql works in procedure, but I can't find answer of this case exactly. Every next procedure is dependent on the previous so that why I want them to work not in parallel. Something more, these procedures are consist of creating temporary tables, updates, deletes, selects and inserts. I was thinking about something like this (transaction), too:
BEGIN
BEGIN TRY
BEGIN TRANSACTION
IF (new_times_flag = TRUE) THEN
CALL CalcActualZoneUTR(dateFor);
ELSE
UPDATE kt_zones_timeslots_settings SET date_for = dateFor WHERE date_for = oldDateFor;
END IF;
CALL MakeRealShifts(dateFor);
CALL InsertSeparateShifts(dateFor);
END TRY
BEGIN CATCH
ROLLBACK;
END CATCH
END
Solution 1:[1]
The calls in the procedure are executed one by one, not in parallel.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | slaakso |
