hi all,
i have written one function, but it is showing some error, the code is as follows:
i want to insert the whole data with only the date incremented by 1 day till it equals to the end date. but it shows the error:
parser:parse error at or near "$6" at character 112
can anyone help me?
TIA
i have written one function, but it is showing some error, the code is as follows:
Code:
CREATE OR REPLACE FUNCTION fn_name(int8, int8, int8, "varchar", date, date) RETURNS "varchar" AS ' declare dt numeric; a varchar(20); start_dt alias for $5; end_dt alias for $6; et alias for $4; begin if et = \'D\' then while not start_dt = end_dt loop insert into tbl1(event_cd, party_cd, project_cd, event_type,event_dt) values ($1,$2,$3,$4,start_dt) start_dt:=to_date(start_dt,\'yyyy-mm-dd\') + interval \'1 day\'; end loop; end if; return \'a\'; end' LANGUAGE 'plpgsql' VOLATILE;
parser:parse error at or near "$6" at character 112
can anyone help me?
TIA
Comment