pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: anoopmadavoor@gmail.com <anoopmadavoor@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: How I can return a set of recordset from PL/Python
Date: Wed, 27 Jun 2007 00:24:21 -0700
Message-ID: <1182929061.446086.305950@w5g2000hsg.googlegroups.com> (raw)


Hi,

      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');

Thanks:

Anoop G




Message-ID: <1182929061.446086.305950@w5g2000hsg.googlegroups.com>
Permalink:  ../1182929061.446086.305950@w5g2000hsg.googlegroups.com/
Also on:    postgresql.org/message-id/1182929061.446086.305950@w5g2000hsg.googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: anoopmadavoor@gmail.com
  Subject: Re: How I can return a set of recordset from PL/Python
  In-Reply-To: <1182929061.446086.305950@w5g2000hsg.googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox