Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5KGmVa94961 for ; Wed, 20 Jun 2001 12:48:31 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5IAVRa02209 for ; Mon, 18 Jun 2001 06:31:27 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5IAPud63663 for pgsql-sql@postgresql.org; Mon, 18 Jun 2001 06:25:56 -0400 (EDT) (envelope-from news) From: Adriaan Joubert X-Newsgroups: comp.databases.postgresql.sql Subject: CAST issue/ecpg Date: Mon, 18 Jun 2001 11:06:40 +0300 Organization: APL Financial Services (Overseas) Ltd Lines: 18 Message-ID: <3B2DB690.A646A3B1@albourne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.18 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200106/313 X-Sequence-Number: 3586 Hi, I've hit a slightly annoying issue with casts and inidicators. Due to problems using constant INT8's in queries (no <= for float and int8), I put a cast around all INT8 values. This gives me e.g. EXEC SQL INSERT INTO stats (stats_id, obj_id, stats_time, stats_val, stats_par, snap_time) VALUES (:stats_id, :obj_id, CAST (:stats_time AS BIGINT ), :stats_val, :stats_par, CAST (:snap_time AS BIGINT ) :i_snap_time); ecpg does not like a CAST with an indicator after it, and dies with a parse error. Without an inidicator variable it seems happy. Adriaan