Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.9.1/8.9.1) with ESMTP id LAA16489 for ; Fri, 8 Jan 1999 11:41:37 -0500 (EST) (envelope-from byronn@insightdist.com) Received: from insightdist.com (nobody@localhost) by u1.abs.net (8.9.0/8.9.0) with UUCP id LAA08470 for pgsql-interfaces@hub.org; Fri, 8 Jan 1999 11:19:39 -0500 (EST) X-Authentication-Warning: u1.abs.net: nobody set sender to insightdist.com!byronn using -f Received: from ceodev by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA34816; Fri, 8 Jan 1999 11:05:37 -0500 Received: from byronn by ceodev (AIX 4.1/UCB 5.64/4.03) id AA57856; Fri, 8 Jan 1999 11:00:16 -0500 Message-Id: <36962D5B.5D4FBAA2@insightdist.com> Date: Fri, 08 Jan 1999 11:07:56 -0500 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: bill@hammondgroves.com Cc: "pgsql-interfaces@hub.org" , "Ken J. Wright" , "Thomas G. Lockhart" Subject: Re: Money type mapping to backend (MORE) References: <199901081135.GAB79140@osage.gate.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bill Hutto wrote: > > Please send the "psqlodbc.log" file of the session. This will show the sql statement > > as sent to the backend and prove once and for all what the error is. It is hard to > > make a diagnosis without knowing what really is going wrong. > > OK Byron, I've attached the session using data bound controls from > Visual Basic. > > Table Name: visdata > > Fields: > field1 char(40) > amount money > quantity int8 > The problem with trying to put quotes around the "amount" field is that on the odbc side, I have no idea that it is indeed a money type. Since there is no SQL_MONEY type, I have no way of knowing that the destination is a PG_MONEY type. And since we don't have a real prepared statement with parameters, I can't ask the backend to tell me what the parameter data type is. But there might be a workaround. The driver will quote character type parameters. Can you somehow tell vb/ado that the field needs to be a character field? Ultimately what we want is the following odbc call: SQLBindParamter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_FLOAT, SQL_VARCHAR, ...) See that 5th argument, that would tell the driver to convert the input data from a float to a character before sending it to the backend, which would result in quotes around it. You could also use SQL_CHAR there. Byron