From: | "Thomas LeBlanc" <thomasatiem(at)hotmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Execute Function from VB/ADO |
Date: | 2003-10-10 15:52:16 |
Message-ID: | Law9-F126Q5Ojlwl5Wq00003e73@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Here is my function:
CREATE OR REPLACE FUNCTION public.getLatestInBinsBetween(timestamp,
timestamp, varchar, varchar)
RETURNS SETOF record AS
'
SELECT cmt.binid, cmt.sitename, cmt.exerciseid,
Max(cmt.datetimestamp) AS datetimestamp, max(cmt.issuancetime) AS
IssuanceTime
FROM consolidatedMetReading cmt INNER JOIN (SELECT Distinct BinID,
SiteName, ExerciseID
FROM consolidatedMetReading gbib
WHERE gbib.BinID BETWEEN $1 and $2
AND gbib.SiteName = $3
AND gbib.ExerciseID = $4) gbib
ON gbib.BinID = cmt.BinID
AND gbib.SiteName = cmt.SiteName
AND gbib.ExerciseID = cmt.ExerciseID
GROUP BY cmt.binid, cmt.sitename, cmt.exerciseid
ORDER BY cmt.binid, cmt.sitename, cmt.exerciseid
'
LANGUAGE 'sql' VOLATILE;
here is the sql statement from a SQL window:
SELECT *
FROM getLatestInBinsBetween('10-08-2003', '10-09-2003', 'Anniston',
'real')
AS gLIBB(binid timestamp, sitename varchar, exerciseid varchar,
datetimestamp timestamp, issuancetime timestamp)
How can I execute this from a ADO connection?
Thomas LeBlanc
_________________________________________________________________
Fast, faster, fastest: Upgrade to Cable or DSL today!
https://broadband.msn.com
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 2003-10-10 16:11:15 | Re: Humor me: Postgresql vs. MySql (esp. licensing) |
Previous Message | scott.marlowe | 2003-10-10 15:37:52 | Re: Humor me: Postgresql vs. MySql (esp. licensing) |