<snip>
> 
> There's an example in the manuals - chapter "7.2.1.4. Table Functions"
> 
> SELECT *
>      FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc')
>        AS t1(proname name, prosrc text)
>      WHERE proname LIKE 'bytea%';
> 
> So basically, you need to supply the type definitions in your SELECT if 
> you aren't going to supply it in the function definition.

ok I tried to rewrite as follows but I get an error that says "a column
definition list is required fro functions returning record

here is my function and call for it now
CREATE OR REPLACE FUNCTION "public"."loginbyindidgettest" (integer)
RETURNS SETOF "pg_catalog"."record" AS'
declare

iindid alias for $1;
returnRec RECORD;

begin

for returnRec in select t1.indid, t1.title, t1.firstname, t1.middlename,
t1.lastname, t1.suffix, t1.loginname, t1.loginnameid, t1.ad,t1.current,
t1.email, t1.note
from tblindividual inner join tblloginname on (tblindividual.indid =
tblloginname.indlink) as t1
where tblloginname.indlink = iindid
order by tblindividual.lastname, tblindividual.firstname,
tblindividual.middlename, tblloginname.loginname
loop
             return next returnRec;
     end loop;
     return;
end;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

select * from loginbyindidgettest(43650);



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to