----------------------------------------------------------------------- WORKLOG TASK -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- TASK...........: Parameterized VIEWs CREATION DATE..: Mon, 24 Oct 2011, 16:57 SUPERVISOR.....: IMPLEMENTOR....: COPIES TO......: CATEGORY.......: Server-RawIdeaBin TASK ID........: 242 (http://askmonty.org/worklog/?tid=242) VERSION........: Benchmarks-3.0 STATUS.........: Un-Assigned PRIORITY.......: 60 WORKED HOURS...: 0 ESTIMATE.......: 0 (hours remain) ORIG. ESTIMATE.: 0 PROGRESS NOTES: DESCRIPTION: Quote:
We need views which can take a specified number of parameters of a specified type. For example, the syntax could be something like:
CREATE VIEW exampleView (@timepoint DATE) AS SELECT FROM WHERE colDate <= @timepoint;
Implementation could be done as simple as doing a search and replace with the variable and the parameter given when the view is used, such as:
SELECT * FROM exampleView('2001-01-01');
ESTIMATED WORK TIME ESTIMATED COMPLETION DATE ----------------------------------------------------------------------- WorkLog (v4.0.0)