<html><div style='background-color:'><P><FONT face=Arial size=2>Hi Guys</FONT></P>
<P><FONT face=Arial size=2>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.</FONT></P>
<P>CREATE OR REPLACE FUNCTION return_daily_card_list(d "varchar", m "varchar", y "varchar")<BR> RETURNS refcursor AS<BR>$BODY$ <BR>declare <BR> pointer refcursor; <BR>begin <BR> open pointer for <BR> select * <BR> from daily_time_record <BR> where<BR> if<BR> d = SELECT EXTRACT(YEAR FROM daily_time_record.daily_time_card_date)<BR> and<BR> m = SELECT EXTRACT(MONTH FROM daily_time_record.daily_time_card_date)<BR> and<BR> y = SELECT EXTRACT(DAY FROM daily_time_record.daily_time_card_date)<BR> and if;<BR> return pointer; <BR>end; <BR>$BODY$<BR> LANGUAGE 'plpgsql' VOLATILE;<BR>ALTER FUNCTION return_daily_card_list(d "varchar", m "varchar", y "varchar") OWNER TO postgres;</P>
<DIV class=RTE>ERROR: syntax error at or near "$1" at character 44<BR>QUERY: select * from daily_time_record where if $1 = SELECT EXTRACT(YEAR FROM daily_time_record.daily_time_card_date) and $2 = SELECT EXTRACT(MONTH FROM daily_time_record.daily_time_card_date) and $3 = SELECT EXTRACT(DAY FROM daily_time_record.daily_time_card_date) and if<BR>CONTEXT: SQL statement in PL/PgSQL function "return_daily_card_list" near line 15<BR></DIV>
<DIV class=RTE>CREATE TABLE daily_time_record<BR>(<BR> daily_time_card_id int4 NOT NULL DEFAULT nextval 'daily_time_record_daily_time_card_id_seq'::regclass),<BR> daily_time_card_date timestamptz,<BR> employee_id varchar(10),<BR> agreed_start_time timestamptz,<BR> actual_start_time timestamptz,<BR> total_hours float8,<BR> CONSTRAINT daily_time_record_pkey PRIMARY KEY (daily_time_card_id)<BR>) <BR>WITHOUT OIDS;<BR>ALTER TABLE daily_time_record OWNER TO postgres;</DIV></div></html>