SQL server may require the use of cursor.callproc() to execute a stores
procedure, see the documentation section on "raw cursor access" for that.
In that case you are better off just executing the textual SQL directly.
Though if the function works inside of a SELECT then sure the same use as
with
What if you wanted to execute a Stored Procedure but from SQL Server
instead of PostgreSQL? Will the same logic work?
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
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 "
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
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;
> re
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 where
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
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:
fro
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 sqlalchemy import func
>>
>>
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 sqlalchemy import func
result = engine.execute(func.name_of_my_pg_function(1, 2, 3))
S
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 sqlalchemy import func
result = engine.execute(func.name_of_my_pg_function(1, 2, 3))
Manipulation of cursors is not supported
I think the subject line makes it pritty clear.
I want to know how i can use the expression api to make calls to
postgresql stored procedures written in plpgsql.
For example how to pass input parameters and how to manipulate cursor
objects etc.
happy hacking.
Krishnakant.
--
You received this
12 matches
Mail list logo