Functions Returning Record Datatype

Поиск
Список
Период
Сортировка
От A E
Тема Functions Returning Record Datatype
Дата
Msg-id 20040103180737.17495.qmail@web12104.mail.yahoo.com
обсуждение исходный текст
Список pgsql-general
Hi,
 
I was wondering if I have a function that returns a record datatype, and I call it using the as keyword to specify the table structure, can I return a different structure than the one specified?
 
Say I call  select * from xy ('abc', 'def') as (samplea char,  sampleb char) for a function of
 
CREATE FUNCTION xy(char, char) RETURNS record AS'
Declare
testout record;
if userallowed = 0 then
 
else
    for testout in ''select * from testtable'' loop
          return next testout;
    end loop;
end if;
return null;
end;'
 language 'plpgsql';
 
Can I instead send back "errordescription text, errornumber int, errornext int"? How do I do that? 
 
I have a web front end and I have to get custom database errors to the front end. Maybe there is something more simple?

TIAAlex Erwin

В списке pgsql-general по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Network Problems over past 48hrs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Any way to have CREATEUSER privs without having all privs?