Hi Guys
Trying to select records via matching timestamptz with varchar parameters in postgres 8.1, using the 8.1-404 JDBC3 driver. We're also running Java 1.5.0-05.
CREATE OR REPLACE FUNCTION return_daily_card_list(d "varchar", m "varchar", y "varchar")
RETURNS refcursor AS
$BODY$
declare
pointer refcursor;
begin
open pointer for
select *
from daily_time_record
where
if
d = SELECT EXTRACT(YEAR FROM daily_time_record.daily_time_card_date)
and
m = SELECT EXTRACT(MONTH FROM daily_time_record.daily_time_card_date)
and
y = SELECT EXTRACT(DAY FROM daily_time_record.daily_time_card_date)
and if;
return pointer;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION return_daily_card_list(d "varchar", m "varchar", y "varchar") OWNER TO postgres;