on 10-21-2008 1:57 AM
Hi, I have run the following command successfully without the WHERE clause on the last line. However, when I try to use a parameter, it fails. Is there anything wrong with it?
CREATE TABLE #DateList
(
Dates DateTime NOT NULL PRIMARY KEY
);
DECLARE locDate DateTime;
DECLARE BEG DateTime;
DECLARE FIN DateTime;
DECLARE N DOUBLE PRECISION;
//-- Sets the 1st date in the table.
SET BEG=TIMESTAMP '2000-01-01 00:00:00';
//-- Sets the Last date in the Table.
SET FIN=TIMESTAMP '2008-12-31 00:00:00';
//-- Fills all the dates in between...
SET locDate = BEG;
WHILE locDate <= FIN DO
INSERT INTO #DateList
(Dates)
SELECT locDate AS Dates FROM #dummy;
/* This should work, but it looks like Nexus haven't written the code yet to
actually add dates, the slack dogs.
SET locDate=locDate + INTERVAL '1' DAY;
*/
SET N = CAST(locDate AS DOUBLE PRECISION) + 1;
SET locDate = CAST(N AS TIMESTAMP);
END WHILE;
SELECT *
FROM #DateList;
DROP TABLE #DateList;
SELECT "WeatherDetail"."RainFall", "WeatherStation"."Name", "WeatherDetail"."Date"
FROM "WeatherDetail" "WeatherDetail" INNER JOIN "WeatherStation" "WeatherStation" ON "WeatherDetail"."WeatherStationID"="WeatherStation"."WeatherStationID"
WHERE "WeatherStation"."Name" = {?Station}
Please remember to give all necessary information, such as the error message. This will help users identify the cause of your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.