troubleshooting Question

function in postgres is not giving me return.

Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland asked on
PostgreSQLSQL
6 Comments2 Solutions625 ViewsLast Modified:
1.  i've created the following function in postgres.


CREATE OR REPLACE FUNCTION get_level_between_dates(in_container_id integer, "start" time with time
    zone, "end" time with time zone) RETURNS SETOF integer AS
'
SELECT level FROM level
CREATE OR REPLACE FUNCTION get_level_between_dates(in_container_id integer, "start" time with time
    zone, "end" time with time zone) RETURNS SETOF integer AS

'SELECT level FROM level
   WHERE container_id = $1
   AND date >= $2  AND date <= $3 '
LANGUAGE SQL;


2. when i call the function with the following parameters (a) i dont receive anything as response, when i pass the query as in (b) i receive response, what is my mistake?

a)
select get_level_between_dates(1048577, '2007-04-23 08:00:00', '2007-07-22 08:00:00');

b)
select level from level where container_id = 1048577 and date >= '2007-04-23 08:00:00'
and date <= '2007-07-22 08:00:00'


ASKER CERTIFIED SOLUTION
earth man2

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros