how to returns set of records in PL/python
От | Anoop G |
---|---|
Тема | how to returns set of records in PL/python |
Дата | |
Msg-id | 1a027d210804070547w3117f195qa279b487b896674d@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: how to returns set of records in PL/python
Re: how to returns set of records in PL/python |
Список | pgsql-sql |
Hi ,<br /><br /> Iam new to plpython,how can I return a recordset from a plpython function?<br /><br /> Is there is anyway give me an example;<br /><br /> <br />plpgsql function <br />--------------------------------<br /><br />CREATE ORREPLACE FUNCTION function_to_get_all_countries() RETURNS SETOF RECORD AS $BODY$<br /> DECLARE <br /><br /> r RECORD; <br /> <br />BEGIN<br /><br /> FOR r IN SELECT pk_bint_country_id,vchr_country FROM tbl_country LOOP<br/> RETURN NEXT r;<br /> END LOOP;<br /> RETURN;<br /><br />END<br />$BODY$ LANGUAGE 'plpgsql';<br/><br /><br /><br /><br />How i can get the same result using plpythonu and how I can call the function (isthere any user defined type required like in plpgsql)?<br /><br />Thanks in advance<br /><br />Anoop<br />
В списке pgsql-sql по дате отправления: