PL/PgSQL: selects into strings

Поиск
Список
Период
Сортировка
От Virgilio Sanz
Тема PL/PgSQL: selects into strings
Дата
Msg-id 19991202161624.D1959@el-mundo.net
обсуждение исходный текст
Ответы Re: [SQL] PL/PgSQL: selects into strings  (wieck@debis.com (Jan Wieck))
Список pgsql-sql
Hi list,

I'm just added to the list and I'm not sure whether the following is a
FAQ or not possible. Anyway, here it goes:
Is there a way to execute a query stored in a string?

I mean, something like:

function test(text) as returns opaque as '
declarev_weekday alias for $1;s_qry text;rec record;
begins_qry = ''select field1,field2, '' || v_weekday || '' from t_diary'';for rec in exec_sql(s_qry)
--               ^ this is what I'm looking for...
--        [do what is needed]loopend loop;
end;
' language 'plpgsql';

Thanks in advance,
Virgilio

--
Virgilio Sanz               vsanz@el-mundo.net virgilio.sanz@el-mundo.es
Diario el Mundo en Internet http://www.el-mundo.es
Email me with "send key pub" on subject to get my public key
Kime's Law for the Reward of Meekness:Turning the other cheek merely ensures two bruised cheeks.

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

Предыдущее
От: Karel Zak - Zakkr
Дата:
Сообщение: Re: [SQL] arrays
Следующее
От: Chris Griffin
Дата:
Сообщение: Logical and for int4?