Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
DELIMITER ;;
CREATE DEFINER=`ispyb_root`@`%` PROCEDURE `retrieve_containers_on_beamline_with_status`(IN p_beamline varchar(20), IN p_status varchar(45))
CREATE OR REPLACE DEFINER=`ispyb_root`@`%` PROCEDURE `retrieve_containers_on_beamline_with_status`(IN p_beamline varchar(20), IN p_status varchar(45))
READS SQL DATA
COMMENT 'Returns a multi-row result-set with info about when containers on beamline p_beamline last had status p_status'
BEGIN
IF NOT (p_status IS NULL) AND NOT (p_beamline IS NULL) THEN
SELECT c.barcode "barcode", c.sampleChangerLocation "location", max(ch.blTimeStamp) "added"
FROM Container c
LEFT OUTER JOIN ContainerHistory ch ON c.containerId = ch.containerId AND ch.status = p_status
WHERE c.containerStatus = p_status AND ch.beamlineName = p_beamline
WHERE c.containerStatus = p_status AND ch.beamlineName = p_beamline
GROUP BY c.barcode, c.sampleChangerLocation
ORDER BY ch.blTimeStamp ASC;
ELSE
ELSE
SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=1644, MESSAGE_TEXT='Mandatory arguments p_status and/or p_beamline are NULL';
END IF;
END ;;
Expand Down