X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 00ED93A2D15 for ; Sat, 15 Jan 2005 19:21:34 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44125-04 for ; Sat, 15 Jan 2005 19:21:22 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 3928E3A18B5 for ; Sat, 15 Jan 2005 19:21:22 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j0FJLFAv056159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 15 Jan 2005 12:21:18 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j0FJLFh4010253; Sat, 15 Jan 2005 12:21:15 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j0FJLFsL010252; Sat, 15 Jan 2005 12:21:15 -0700 (MST) (envelope-from mfuhr) Date: Sat, 15 Jan 2005 12:21:15 -0700 From: Michael Fuhr To: "Frost, Mr. Michael (contractor)" Cc: pgsql-interfaces@postgresql.org Subject: Re: ECPG and CURSOR declaration Message-ID: <20050115192115.GA10081@winnie.fuhr.org> References: <5188F15076BC7A4DBB705747602058C11AA6D1@mailhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5188F15076BC7A4DBB705747602058C11AA6D1@mailhost> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/9 X-Sequence-Number: 5235 On Wed, Jan 12, 2005 at 08:04:24AM -0800, Frost, Mr. Michael (contractor) wrote: > Hi All. The following code compiles and works fine on 7.3. However, > with 7.4 it doesn't make it through the compiler. With 7.4 it seems to > want the cursor declare to be in the same subroutine as the fetch. The exact error message might tell us more than "seems to want." I wrote a test program similar to yours and got the following error when I ran ecpg: curstest.pgc:23: ERROR: trying to access an undeclared cursor testcurs I moved the function that declares the cursor to earlier in the file so it came before the function that used the cursor. The program then compiled and ran fine using 8.0.0rc5. -- Michael Fuhr http://www.fuhr.org/~mfuhr/