Re: [GENERAL] Q: How do I return differnt rows depending on values

2004-03-19 Thread Joe Conway
Max Ahston wrote: create or replace function get_dns(varchar(40), varchar(40)) returns setof holder as ' declare r holder%rowtype; begin IF ($2 == "tigris") then for r in select Attribute, op, value FROM radreply WHERE username = $1 loop return next r; end

[GENERAL] Q: How do I return differnt rows depending on values in a PL/pgSQL function?

2004-03-19 Thread Max Ahston
Hi, I am pretty new to pgsql but have the basic knowledge of sql. I am trying to figure out how to solve the following with a funtion: I want to run a function (I guess written in pl/pgsql) that takes two variables (username and nasname). Depending on boxname I want two different results. rad