Skip to content
Snippets Groups Projects
Commit e408ea49 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

DOC: more documentation added

parent 2554332d
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
*/
/* Documentation including (?) has to be checked by an expert. */
/* Question: What is datetime dot notation? */
DROP PROCEDURE IF EXISTS db_2_0.applyPOV;
DELIMITER //
......@@ -34,17 +35,23 @@ CREATE PROCEDURE db_2_0.applyPOV(in sourceSet VARCHAR(255), /* (?) Name of the t
0 check for "equals NULL"
!0 check for "not NULL"
-> check whether a reference exists
( (?) check for datetime intervals
!( (?) check for being outside of datetime intervals
other operators (all SQL operators (?))
these other operators can be used either with or without an aggregation
to use an aggregation set agg to non-zero
all SQL aggregations can be used
*/
in vText VARCHAR(255),
in vInt INT,
in vDouble DOUBLE,
in vText VARCHAR(255), /* (?) the text value to be checked against using operator o */
in vInt INT, /* the integer value to be checked against using operator o */
in vDouble DOUBLE, /* the double value to be checked against using operator o */
in unit_sig BIGINT,
in vDoubleStdUnit DOUBLE,
in stdUnit_sig BIGINT,
in vDateTime VARCHAR(255),
in vDateTimeDotNotation VARCHAR(255),
in agg CHAR(3),
in pname VARCHAR(255))
in agg CHAR(3), /* an SQL aggregate function or NULL when no aggregation should be used */
in pname VARCHAR(255)) /* name of the property, this name is only used for reporting more meaningful warnings */
POV_LABEL: BEGIN
DECLARE data TEXT DEFAULT NULL; /*data subselect statement string*/
DECLARE sTextData VARCHAR(20000) DEFAULT NULL; /*SELECT PREFIX for data subselect plus WHERE CLAUSE for text_data*/
......@@ -92,8 +99,12 @@ POV_LABEL: BEGIN
SET sTextData = 'SELECT DISTINCT domain_id, entity_id, property_id FROM `text_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `enum_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `integer_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `double_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `date_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data` AS subdata WHERE subdata.value IS NOT NULL UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `reference_data` AS subdata WHERE subdata.value IS NOT NULL';
ELSEIF o = "(" or o = "!(" THEN
SET sTextData = IF(vText IS NULL,' SELECT DISTINCT domain_id, entity_id, property_id FROM `date_data`', IF(vDateTimeDotNotation IS NULL, NULL, CONCAT(' SELECT DISTINCT domain_id, entity_id, property_id FROM `date_data` AS subdata WHERE ',getDateWhereClause(vDateTimeDotNotation,o))));
SET sDatetimeData = IF(vText IS NULL,' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data`', IF(vDateTime IS NULL, NULL, CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data` AS subdata WHERE ',getDateTimeWhereClause(vDateTime,o))));
SET sTextData = IF(vText IS NULL, ' SELECT DISTINCT domain_id, entity_id, property_id FROM `date_data`',
IF(vDateTimeDotNotation IS NULL, NULL,
CONCAT(' SELECT DISTINCT domain_id, entity_id, property_id FROM `date_data` AS subdata WHERE ', getDateWhereClause(vDateTimeDotNotation, o))));
SET sDatetimeData = IF(vText IS NULL, ' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data`',
IF(vDateTime IS NULL, NULL,
CONCAT(' UNION ALL SELECT DISTINCT domain_id, entity_id, property_id FROM `datetime_data` AS subdata WHERE ', getDateTimeWhereClause(vDateTime, o))));
SET vText = NULL;
ELSEIF agg IS NOT NULL THEN
#-- find aggregated value (min/max...)
......@@ -182,6 +193,8 @@ POV_LABEL: BEGIN
DEALLOCATE PREPARE stmt3;
DEALLOCATE PREPARE stmtPOVkeepTbl;
/* Question: why select AS and not select INTO? */
SELECT @stmtPOVkeepTblStr as applyPOVStmt1, @stmtPOVStr as applyPOVStmt2, keepTabl as applyPOVIntermediateResultSet;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment