Re: [INTERFACES] problem with numeric

Поиск
Список
Период
Сортировка
От Byron Nikolaidis
Тема Re: [INTERFACES] problem with numeric
Дата
Msg-id 38978DEC.6E06E701@home.com
обсуждение исходный текст
Ответ на problem with numeric  ("Ken J. Wright" <ken@ori-ind.com>)
Список pgsql-interfaces

"Ken J. Wright" wrote:
> 
> v6.5.3
> 
> While testing the new ODBC driver I ran into the following problem with
> queries on numeric fields. Unless the values are surrounded by single quote
> marks, the query fails with the message: Unable to identify an operator '='
> for types 'numeric' and 'float'. This occurs in the WHERE clause of the
> query.
> 
> SELECT * from tbl WHERE numfld = 99.125;
> UPDATE tbl SET numfld = 99.13 WHERE numfld = 99.125;
> 
> An INSERT works fine.
> 
> These statements execute ok on float fields, but not numeric. This happens
> via ODBC and also with psql from a Linux console.
> 
> Ken
> 
> ************

Ok, I can put quotes around it, as long as you use a bound parameter. 
In other words, you have to use something like "select * from tbl where
numfld = ?", and then bind parameter 1 to be the numeric type.

The driver will not try to put quotes around a numeric embedded into an
sql query.

For completeness, I think Postgres should work with or without the
quotes, after all, it is a numeric field.   If this where the case, then
flat queries (i.e., no Bounded parameters) would work too.  

You might want to post this to the hackers list too.

Byron

Byron


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Byron Nikolaidis
Дата:
Сообщение: Re: [INTERFACES] ODBC bind trouble with bigint
Следующее
От: Byron Nikolaidis
Дата:
Сообщение: Re: [INTERFACES] problem with numeric