By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

How to return a record and sets of record in plpython

P: n/a
RL
Hi,

I am trying to implement a few functions in Plpython (in Postgresql 8.0.1).
However, I could find the solution in the documentation, so I would appreciate
your help. My question is how to return a record and sets of records in Plpython
if it's possible. For instance, if we have a table name EMP

CREATE TABLE EMP ( name text, salary integer, age integer )

according to the documentation, the following code will return a composite
type:

CREATE FUNCTION new_emp() RETURNS EMP AS '
SELECT text "None" AS name,
1000 AS salary,
25 AS age;
' LANGUAGE SQL;

and

"RETURN NEXT" in Pl/pgsql allows us to return multiple rows

How am I going to do the same thing in plpython?
Thanks,

Ruey-Lung Hsiao
Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.