------=_Part_16329_22915949.1207572442520
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi ,
Iam new to plpython,how can I return a recordset from a plpython
function?
Is there is any way give me an example;
plpgsql function
--------------------------------
CREATE OR REPLACE FUNCTION function_to_get_all_countries() RETURNS SETOF
RECORD AS $BODY$
DECLARE
r RECORD;
BEGIN
FOR r IN SELECT pk_bint_country_id,vchr_country FROM tbl_country LOOP
RETURN NEXT r;
END LOOP;
RETURN;
END
$BODY$ LANGUAGE 'plpgsql';
How i can get the same result using plpythonu and how I can call the
function (is there any user defined type required like in plpgsql)?
Thanks in advance
Anoop
------=_Part_16329_22915949.1207572442520
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi ,<br><br> Iam new to plpython,how can I return a recordset
from a plpython function?<br><br> Is there is any way give me an
example;<br><br> <br>plpgsql function
<br>--------------------------------<br><br>CREATE OR REPLACE 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 (is there any user defined type required like in
plpgsql)?<br><br>Thanks in advance<br><br>Anoop<br>
------=_Part_16329_22915949.1207572442520--