Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
On 12/09/11 03:09, Michael Bayer wrote: On Sep 11, 2011, at 3:43 PM, Krishnakant Mane wrote: On 12/09/11 00:56, Michael Bayer wrote: You use the func construct to invoke a function. This can be passed to an execute() method directly where it should embed itself into a SELECT: from

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Michael Bayer
On Oct 15, 2011, at 7:52 AM, Krishnakant Mane wrote: On 12/09/11 03:09, Michael Bayer wrote: On Sep 11, 2011, at 3:43 PM, Krishnakant Mane wrote: On 12/09/11 00:56, Michael Bayer wrote: You use the func construct to invoke a function. This can be passed to an execute() method directly

Re: [sqlalchemy] Degenerate relationship?

2011-10-15 Thread Michael Bayer
On Oct 14, 2011, at 9:45 PM, Mark Erbaugh wrote: There are two tables pump and curve. The curve table has three fields, curve_pn, head and gpm. The design is that the rows with the same curve_pn value represent x,y points (head,gpm) on a pump performance curve. Each row in the pump table

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
Thanks michael, But my problem here is different. Let me give you the exact stored procedure that we have here for execution. create or replace function getGroupByCode(group_code groups.groupcode%type) returns setof groups as $$ declare res groups; begin for res in select * from groups

Re: [sqlalchemy] Degenerate relationship?

2011-10-15 Thread Mark Erbaugh
On Oct 15, 2011, at 10:17 AM, Michael Bayer wrote: On Oct 14, 2011, at 9:45 PM, Mark Erbaugh wrote: There are two tables pump and curve. The curve table has three fields, curve_pn, head and gpm. The design is that the rows with the same curve_pn value represent x,y points (head,gpm) on

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Michael Bayer
On Oct 15, 2011, at 10:23 AM, Krishnakant Mane wrote: create or replace function getGroupByCode(group_code groups.groupcode%type) returns setof groups as $$ declare res groups; begin for res in select * from groups where groupcode = group_code loop return next res; end loop; return;

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Krishnakant Mane
On 15/10/11 22:17, Michael Bayer wrote: that sounds like an issue in the procedure itself, such as running it on the wrong database, or the wrong groups table otherwise. there could be many schemas/databases that contain a groups table. Get the procedure to work with psql first using

Re: [sqlalchemy] still unclear how to invoke stored procedures with sqlalchemy

2011-10-15 Thread Michael Bayer
On Oct 15, 2011, at 3:24 PM, Krishnakant Mane wrote: On 15/10/11 22:17, Michael Bayer wrote: that sounds like an issue in the procedure itself, such as running it on the wrong database, or the wrong groups table otherwise. there could be many schemas/databases that contain a groups