X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DBEC952EC2 for ; Tue, 26 Jul 2005 15:05:00 -0300 (ADT) 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 04419-02 for ; Tue, 26 Jul 2005 18:04:49 +0000 (GMT) Received: from mailrtr1.mailzone.edeltacom.com (mailrtr1.mailzone.edeltacom.com [216.248.176.149]) by svr1.postgresql.org (Postfix) with ESMTP id 1A1B652EB7 for ; Tue, 26 Jul 2005 15:04:48 -0300 (ADT) Received: from [192.168.1.30] ([216.248.189.97]) by mailrtr1.mailzone.edeltacom.com (MOS 3.5.9-GR) with ESMTP id CAJ57019; Tue, 26 Jul 2005 14:04:20 -0400 (EDT) Message-ID: <42E67B81.4040501@fis-cal.com> Date: Tue, 26 Jul 2005 13:05:53 -0500 From: Bob Caryl User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Greg Campbell Cc: pgsql-odbc@postgresql.org Subject: Re: Ok... I got most of it working but . . . References: <42E66F03.7010302@fis-cal.com> <42E6761B.6020800@us.michelin.com> In-Reply-To: <42E6761B.6020800@us.michelin.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200507/160 X-Sequence-Number: 5625 Greg Campbell wrote: > Is that supposed to be an SQL string, like > "INSERT INTO my_table (field1, field2, field3, field3) VALUES > (0.00,0.00,0.00)" > > parentheis -- not curly braces? > > > > Bob Caryl wrote: > >> I am using arrays of double precision numbers in certain columns in >> my table. When I format the CString object (analogous to >> Glib::ustring objects in the linux world) to update this column it >> looks like this: >> >> >> "{0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00}" >> >> >> However, when the odbc driver tries to update the new added record, I >> get the following error message server side (and at my application): >> >> ERROR: invalid input syntax for type double precision: >> "{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}" >> >> Evidently, the odbc driver is deciding to optimize my query >> perhaps? What am I doing wrong this time? >> >> Thanks, >> >> Bob Caryl >> >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 9: In versions below 8.0, the planner will ignore your desire to >> choose an index scan if your joining column's datatypes do not >> match > To quote the documentation on the use of arrays in postgresql tables: "To INSERT values into an array, you enclose all the array elements in single quotes and braces ({}) and separate multipl elements with a comma." Hence, if I have an array of double precision numbers called misctendamt, and I wanted to insert 16 zero values into that array the INSERT statement would look like this: "INSERT INTO my_table (misctendamt) VALUES '{0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00}'" Unfortunately when using a derived MFC CRecordset object, I do not actually write queries. I have to use class members of my derived CRecordset class that are actually variables corresponding to the columns of my table. So, for the array of double precision numbers, I populate the CString variable with the "{0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00}" data, and then the odbc driver is apparently optimizing it to read "{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}" and it is that the postgresql server is choking on. The server wants to see those decimal points! Bob Caryl