Skip to content

MariaDB SQL code snippets

Karl Levik edited this page Mar 7, 2022 · 1 revision

Populate the container registry with two series of barcodes

DELIMITER ;;

FOR i IN 1..20
DO
  INSERT INTO ContainerRegistry (barcode) VALUES (concat('MX_', LPAD(i, 4, 0)));
END FOR;;

FOR i IN 1001..1040
DO
  INSERT INTO ContainerRegistry (barcode) VALUES (concat('MX_', i));
END FOR;;

DELIMITER ;