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

Re: call stored function from ecpg w/cursor

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Andrew Jarcho <ajarcho(at)nyc(dot)rr(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: call stored function from ecpg w/cursor
Date: 2007-04-29 13:43:14
Message-ID: 20070429134314.GA79176@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-novice
On Sat, Apr 28, 2007 at 10:26:15AM -0400, Andrew Jarcho wrote:
> Michael Fuhr wrote:
> >Could you post a simple example that shows what you're trying to
> >do?  Please describe what you'd like to happen and what actually
> >does happen.
> >  
> Thank you very much Michael for your reply. Here's an example:

Please copy the mailing list on replies so others can contribute
to and learn from the discussion.

>  /* a problem here */
>  EXEC SQL DECLARE c_1 (inval integer) CURSOR FOR SELECT foo(:caseID);

Try this:

   EXEC SQL DECLARE c_1 CURSOR FOR SELECT foo(:caseID);

>  EXEC SQL OPEN c_1 (:caseID);

And this:

   EXEC SQL OPEN c_1;

Also, the code you sent me privately declares and refers to an
indicator variable (result_ind) but doesn't set it in the FETCH
statement.  If your compiler didn't warn about that then consider
turning on whatever flags would print such warnings (e.g., -Wall
if you're using gcc).

-- 
Michael Fuhr

In response to

Responses

pgsql-novice by date

Next:From: Andrew JarchoDate: 2007-04-29 19:39:27
Subject: Re: call stored function from ecpg w/cursor
Previous:From: Jessica FendosDate: 2007-04-29 06:12:29
Subject: PGSQL Query

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