Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id AFF3D63263B for ; Fri, 7 May 2010 17:53:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 94101-02 for ; Fri, 7 May 2010 20:53:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 5C6B16323D0 for ; Fri, 7 May 2010 17:53:38 -0300 (ADT) Received: (qmail 11131 invoked by uid 512); 7 May 2010 20:53:36 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 7 May 2010 20:53:36 -0000 Received: from unknown (HELO ?192.168.24.54?) (183.76.20.107) by sd.tpf.co.jp with SMTP; 7 May 2010 20:53:36 -0000 Message-ID: <4BE47DCC.5040804@tpf.co.jp> Date: Sat, 08 May 2010 05:53:32 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Luciane CC: pgsql-odbc@postgresql.org Subject: Re: ODBC Numeric field issue References: <28486416.post@talk.nabble.com> In-Reply-To: <28486416.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.242 tagged_above=-10 required=5 tests=BAYES_00=-1.9, DNS_FROM_RFC_BOGUSMX=1.668, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/10 X-Sequence-Number: 10257 Hi Luciane, Luciane wrote: > Hi everyone, > > I'm trying to access postgres using a ODBC Driver on a Linux system RedHat, > but I'm getting errors with numeric fields, it works only with one numeric > field. Another erro is that it is inserting a NULL record as well. > Below is my ODBC configuration and extracts from the erros on the debug > file. I've tried different versions of ODBC Drivers with no success. If any > one more experient could help me I'll be very happy. Actually I don't know > what to do anymore. > > Thanks in advance. > > Luciane > > > ------> Odbc Configuration .odbc.ini > [PostG] > #Driver=/usr/lib/libodbcpsql.so.2 > #Driver=/produtos/unixODBC-2.2.14/Drivers/Postgre7.1/.libs/libodbcpsql.so > #Driver=/produtos/unixODBC-2.2.10/Drivers/Postgre7.1/.libs/libodbcpsql.so > #Driver=/produtos/unixODBC-2.2.12/Drivers/Postgre7.1/.libs/libodbcpsql.so > #Driver=/produtos/unixODBC-2.2.13/Drivers/Postgre7.1/.libs/libodbcpsql.so > Driver=/produtos/unixODBC-2.3.0/Drivers/Postgre7.1/.libs/libodbcpsql.so.2 > #Driver=/usr/lib/psqlodbcw.so > Description=drive postgres odbc > ServerPort=10.4.3.21:5432 > Servername=pgs1dsv > Database=pgs1dsv > sername=c_gco > Password=inicio > ReadOnly=no > Protocol=7.4 > RowVersioning=No > ShowSystemTables=No > ShowOidColumn=No > FakeOidIndex=No > Debug=1 > DebugFile=/tmp/postgII.out > Trace=yes > TraceFile=/tmp/ODBCTrace.log > UseServerSidePrepare=1 > DisallowPremature=1 > #Parse=1 > > > ------> Debug - inserting NULL Record > SQLExecute: copying statement params: trans_status=1, len=66, stmt='INSERT > INTO "teste_carga"("s1", "i1", "n1", "n2") VALUES (?,?,?,?)' > stmt_with_params = 'INSERT INTO "teste_carga"("s1", "i1", "n1", "n2") > VALUES (NULL,NULL,NULL,NULL)' > it's NOT a select statement: stmt=140373784 > send_query(): conn=140316008, query='INSERT INTO "teste_carga"("s1", "i1", > "n1", "n2") VALUES (NULL,NULL,NULL,NULL)' > send_query: done sending query I can't see what kind of result you expect. Could you send me directly the Mylog output? > ------> Debug - Issue on the second numeric field > SQLExecute: copying statement params: trans_status=1, len=66, stmt='INSERT > INTO "teste_carga"("s1", "i1", "n1", "n2") VALUES (?,?,?,?)' > copy_statement_with_params: from(fcType)=1, to(fSqlType)=5 > copy_statement_with_params: from(fcType)=1, to(fSqlType)=4 > copy_statement_with_params: from(fcType)=1, to(fSqlType)=2 > copy_statement_with_params: from(fcType)=1, to(fSqlType)=2 How do you bind the 4 parameters? > stmt_with_params = 'INSERT INTO "teste_carga"("s1", "i1", "n1", "n2") > VALUES (00001,0000000001,'0000000001") VALUES > '::numeric,'0000000110Hé'::numeric)' > it's NOT a select statement: stmt=140373784 > send_query(): conn=140316008, query='INSERT INTO "teste_carga"("s1", "i1", > "n1", "n2") VALUES (00001,0000000001,'0000000001") VALUES > '::numeric,'0000000110Hé'::numeric)' > send_query: done sending query > read 1, global_socket_buffersize=4096 > send_query: got id = 'Z' > read 62, global_socket_buffersize=4096 > send_query: got id = 'E' > send_query: 'E' - ERROR: invalid byte sequence for encoding "UTF8": > 0xe95d08