-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path013_variablen.sql
41 lines (27 loc) · 947 Bytes
/
013_variablen.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- Tables
ALTER TABLE variable ADD (disz_id INTEGER NOT NULL, var_sortIndex INTEGER);
ALTER TABLE variable ADD CONSTRAINT varSortIndex UNIQUE (disz_id, var_sortIndex);
DROP TABLE IF EXISTS disziplin_variable;
-- Procedures
DROP PROCEDURE IF EXISTS VariableZuDisziplinZuordnen;
DROP PROCEDURE IF EXISTS VariableVonDisziplinEntfernen;
DROP PROCEDURE IF EXISTS VariableAnlegen;
DROP PROCEDURE IF EXISTS VariableBearbeiten;
DROP PROCEDURE IF EXISTS VariablenEinerDisziplinAnzeigen;
DROP PROCEDURE IF EXISTS VariablenEinerDisziplinEntfernen;
DELIMITER ;;
CREATE PROCEDURE `VariablenEinerDisziplinAnzeigen`(
in_disz_id int
)
BEGIN
SELECT * FROM variable WHERE disz_id = in_disz_id;
END ;;
CREATE PROCEDURE VariablenEinerDisziplinEntfernen (
in_disz_id int
)
BEGIN
-- Return do be deleted rows
CALL VariablenEinerDisziplinAnzeigen(in_disz_id);
DELETE FROM variable WHERE disz_id = in_disz_id;
END ;;
DELIMITER ;