Skip to content
Snippets Groups Projects
Commit cef3fa1c authored by Arno Schoenmakers's avatar Arno Schoenmakers
Browse files

Task #1771: Update single function from processType-20110707-1_0-release-branch

parent da30087b
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
-- 1: get all trees that are scheduled to start in the period: now till now+period
-- 2: get all trees with starttime <=now and stoptime > now ; period param is ignored
-- 3: get all trees with stoptime in the period: now-period till now
-- 4: get all trees with stoptime < now and have state >= FINISHED
--
-- With this function we can get the planned, active or finished trees from the database.
--
......@@ -73,7 +74,13 @@ CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT)
vQuery := vQuery || ' AND t.stoptime > now()-interval ' || chr(39) || $2 || ' minutes' || chr(39);
vSortOrder := 't.stoptime, t.treeID';
ELSE
RAISE EXCEPTION 'groupType must be 0,1,2 or 3 not %', $1;
IF $1 = 4 THEN
vQuery := ' AND t.state >= ' || TSfinished;
vQuery := vQuery || ' AND t.stoptime < now() ';
vSortOrder := 't.treeID';
ELSE
RAISE EXCEPTION 'groupType must be 0,1,2,3 or 4 not %', $1;
END IF;
END IF;
END IF;
END IF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment