Skip to content

Commit ef4ef3f

Browse files
authored
Use CREATE OR REPLACE ... PROCEDURE syntax (#293)
1 parent 68888e3 commit ef4ef3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

schemas/ispyb/stored_programs/sp_retrieve_containers_on_beamline_with_status.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
DELIMITER ;;
2-
CREATE DEFINER=`ispyb_root`@`%` PROCEDURE `retrieve_containers_on_beamline_with_status`(IN p_beamline varchar(20), IN p_status varchar(45))
2+
CREATE OR REPLACE DEFINER=`ispyb_root`@`%` PROCEDURE `retrieve_containers_on_beamline_with_status`(IN p_beamline varchar(20), IN p_status varchar(45))
33
READS SQL DATA
44
COMMENT 'Returns a multi-row result-set with info about when containers on beamline p_beamline last had status p_status'
55
BEGIN
66
IF NOT (p_status IS NULL) AND NOT (p_beamline IS NULL) THEN
77
SELECT c.barcode "barcode", c.sampleChangerLocation "location", max(ch.blTimeStamp) "added"
88
FROM Container c
99
LEFT OUTER JOIN ContainerHistory ch ON c.containerId = ch.containerId AND ch.status = p_status
10-
WHERE c.containerStatus = p_status AND ch.beamlineName = p_beamline
10+
WHERE c.containerStatus = p_status AND ch.beamlineName = p_beamline
1111
GROUP BY c.barcode, c.sampleChangerLocation
1212
ORDER BY ch.blTimeStamp ASC;
13-
ELSE
13+
ELSE
1414
SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=1644, MESSAGE_TEXT='Mandatory arguments p_status and/or p_beamline are NULL';
1515
END IF;
1616
END ;;

0 commit comments

Comments
 (0)