dbTalk Databases Forums  

How to return a record and sets of record in plpython

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss How to return a record and sets of record in plpython in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RL
 
Posts: n/a

Default How to return a record and sets of record in plpython - 03-29-2005 , 06:12 AM






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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.