Skip site navigation (1) Skip section navigation (2)

How I can return a set of recordset from PL/Python

From: "anoopmadavoor(at)gmail(dot)com" <anoopmadavoor(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: How I can return a set of recordset from PL/Python
Date: 2007-06-27 07:24:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

      Anyone who have a knowledge about PL/Python pls help me. I want
to return a set of values from a database table.

I want to write PL/Python function like this

create or replace function cust_name(OUT temp) RETURNS SETOF
<something>  as '
rv = plpy.execute("SELECT * FROM customer )

return <the result obtained in rv>
' LANGUAGE plpythonu;

Sample data and table structure.

create table customer(id int,name text);
insert into customer values(1,'David John');
insert into customer values(2,'Richard Giri');


Anoop G

pgsql-interfaces by date

Next:From: Sun, WayDate: 2007-06-29 19:09:22
Subject: libpq: PQexecParams, binaryFormat and float
Previous:From: René GrünDate: 2007-06-15 13:38:03
Subject: NAN-Values in ECPG-Code

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group