X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6CF66D1B45D for ; Mon, 5 Jan 2004 18:16:34 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 30872-04 for ; Mon, 5 Jan 2004 14:15:43 -0400 (AST) Received: from ssmcmail.nems.noaa.gov (ssmcmail.nems.noaa.gov [205.156.4.221]) by svr1.postgresql.org (Postfix) with ESMTP id A4264D1B43D for ; Mon, 5 Jan 2004 14:15:43 -0400 (AST) Received: from noaa.gov ([140.90.8.138]) by ssmcmail.nems.noaa.gov (Netscape Messaging Server 4.15) with ESMTP id HR141O00.B9M; Mon, 5 Jan 2004 13:15:24 -0500 Message-ID: <3FF9A98D.A98A150A@noaa.gov> Date: Mon, 05 Jan 2004 13:14:37 -0500 From: Paul Tilles Organization: DOC/NOAA/NWS - National Weather Service X-Sender: "Paul Tilles" X-Mailer: Mozilla 4.77 [en]C-CCK-MCD (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: Xiaobiao Fan , Paul Tilles Subject: ecpg - problem compiling prepare and declare statements Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/29 X-Sequence-Number: 16422 Using psql V7.4.1 and ecpg V3.1.0 on RH Linux 7.2, gcc compiler: The following statement precompiles, compiles and links fine: EXEC SQL declare state_cursor cursor for "select unique state from location where post = 1"; I then change the above to EXEC SQL BEGIN DECLARE SECTION; const char *stmt="select unique state from location where post = 1"; EXEC SQL END DECLARE SECTION; EXEC SQL declare state_cursor cursor for :stmt; These statements generate the following warning from the gcc compiler: warning: passing arg 3 of ECPGprepare discards qualifiers from pointer target type and the link fails. What am I doing wrong? TIA, Paul Tilles