Re: returning results from plsql function to plpythonu function - Mailing list pgsql-admin

From c k
Subject Re: returning results from plsql function to plpythonu function
Date
Msg-id CAN2Y=uPSriNSqHwaQO23L6kVzHL4BxtFu8GGbpnY3rpA-jhuyA@mail.gmail.com
Whole thread Raw
In response to Re: returning results from plsql function to plpythonu function  (Lou Picciano <loupicciano@comcast.net>)
Responses Re: returning results from plsql function to plpythonu function  (c k <shreeseva.learning@gmail.com>)
Re: returning results from plsql function to plpythonu function  (Lou Picciano <loupicciano@comcast.net>)
List pgsql-admin
can you please give me the example
I am not a python programmer.

C P Kulkarni


On Sat, Dec 3, 2011 at 11:25 PM, Lou Picciano <loupicciano@comcast.net> wrote:
CP - You're missing a line in the middle; one which will extract specific content(s) from $results.

Because, yes, without such a line, python will only return the object reference.

Lou Picciano


From: "c k" <shreeseva.learning@gmail.com>
To: "pgsql-admin" <pgsql-admin@postgresql.org>, pgsql-general@postgresql.org
Sent: Saturday, December 3, 2011 12:50:16 PM
Subject: [ADMIN] returning results from plsql function to plpythonu function


Hello friends,
I am checking some logic which includes two functions. One is plsql function which returns text. Second function is plpythonu and contains one statement which outputs notice

e.g.
results = plpy.execute("select * from software.func1();")
plpy.notice("%s" % col for col in results[0])

The same result is returned as a final return as notice. But it does not outputs the correct result which is returned from func1 (text in this case). Rather it outputs notice as
NOTICE:  <generator object <genexpr> at 0xb578cb6c>
It doesn't prints the correct notice even by using
plpy.notice("%s" %results)

What can be the problem here?
Thanks for help.


C P Kulkarni

pgsql-admin by date:

Previous
From: Lou Picciano
Date:
Subject: Re: returning results from plsql function to plpythonu function
Next
From: c k
Date:
Subject: Re: returning results from plsql function to plpythonu function