hi all,
i have a table with three columns.
tran_event_cd, event_cd,party_ cd.
can i pass the column name in the function.
where $1 is field name just like event_cd and $2 is its value.
is it possible to do so.
plz any help is appreciated.
TIA
i have a table with three columns.
tran_event_cd, event_cd,party_ cd.
can i pass the column name in the function.
Code:
create or replace function fn_one(int8,int8) returns setof tbl_one as ' declare r tbl_one%rowtype; a alias for $1; b alias for $2; begin for r in select tran_event_cd, event_cd,party_cd from tran_event where $1=$2 loop return next r; end loop; return ''a''; end' language 'plpgsql' volatile;
is it possible to do so.
plz any help is appreciated.
TIA
Comment