X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6DE35D1C9D8; Fri, 1 Aug 2003 11:06:19 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 35366-07; Fri, 1 Aug 2003 08:05:11 -0300 (ADT) Received: from internet.csl.co.uk (internet.csl.co.uk [194.130.52.3]) by svr1.postgresql.org (Postfix) with ESMTP id 0A82BD1C4D5; Fri, 1 Aug 2003 08:06:14 -0300 (ADT) Received: from euphrates.csl.co.uk (host-194-67.csl.co.uk [194.130.52.67]) by internet.csl.co.uk (8.12.8/8.12.8) with ESMTP id h71B6B84017340; Fri, 1 Aug 2003 12:06:11 +0100 Received: from kelvin.csl.co.uk by euphrates.csl.co.uk (8.9.3/ConceptI 2.4) id MAA19259; Fri, 1 Aug 2003 12:06:09 +0100 (BST) Received: from kelvin.csl.co.uk (localhost.localdomain [127.0.0.1]) by kelvin.csl.co.uk (8.12.8/8.12.8) with ESMTP id h71B68vp026934; Fri, 1 Aug 2003 12:06:08 +0100 Received: (from lkind@localhost) by kelvin.csl.co.uk (8.12.8/8.12.8/Submit) id h71B68RX026930; Fri, 1 Aug 2003 12:06:08 +0100 From: Lee Kindness MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16170.18847.811096.853470@kelvin.csl.co.uk> Date: Fri, 1 Aug 2003 12:06:07 +0100 To: pgsql-interfaces@postgresql.org Subject: ECPG: 7.4 and a "to" Variable X-Mailer: VM 7.07 under 21.4 (patch 12) "Portable Code" XEmacs Lucid Cc: Lee Kindness , pgsql-hackers@postgresql.org, Michael Meskes X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/25 X-Sequence-Number: 41684 Guys, looking at ecpg from CVS HEAD's 7.4. The following code fragement: EXEC SQL INCLUDE sqlca; EXEC SQL WHENEVER SQLERROR call sqlprint; void lofsdb_GetMinMaxRxStations(int *from, int *to) { EXEC SQL BEGIN DECLARE SECTION; int l_from = 0; int l_to = 0; EXEC SQL END DECLARE SECTION; *from = 0; *to = 0; EXEC SQL BEGIN; EXEC SQL SELECT MIN(from_station), MAX(to_station) INTO :l_from, :l_to FROM attr_tables WHERE basetab LIKE 'attr_rx_%'; if( sqlca.sqlcode == 0 ) { *from = l_from; *to = l_to; } EXEC SQL COMMIT; } when processed using: /var/lib/pgsql/74b/bin/ecpg -t -I/var/lib/pgsql/74b/include -o x.c x.pc results in the following error: x.pc:4: ERROR: syntax error at or near "to" However this works ok on 7.3.x and when the "to" variable is renamed (e.g. to "to_rx"). Obviously TO is an SQL keyword, but it's not being used within an EXEC SQL definition, so shouldn't break things. Regards, Lee.