Re: How to set numeric in PreparedStatement

Поиск
Список
Период
Сортировка
От Juhan-Peep Ernits
Тема Re: How to set numeric in PreparedStatement
Дата
Msg-id Pine.GSO.4.21.0103221002380.5619-100000@suhkur.cc.ioc.ee
обсуждение исходный текст
Ответ на How to set numeric in PreparedStatement  (Aaron Brashears <gila@gila.org>)
Ответы Re: How to set numeric in PreparedStatement  (Aaron Brashears <gila@gila.org>)
Список pgsql-jdbc

On Wed, 21 Mar 2001, Aaron Brashears wrote:

>   PreparedStatement pstmt = connectoin.prepareStatement(
>     "select id from account where balance > ? and balance < ?";
>   pstmt.setDouble( 1, 10.0 );
>   pstmt.setDouble( 2, 100.0 );
>   ResultSet rs = pstmt.executeQuery();
>   ...
>
> And finally, the exception thrown:
>
> Exception in thread "main" java.sql.SQLException: ERROR:  Unable to identify an operator '>' for types 'numeric' and
'float8'
>         You will have to retype this query using an explicit cast
>


May be this would help?

     "select id from account where balance > ?::numeric(10,2) and
balance < ?::numeric(10,2)";


Juhan Ernits



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

Предыдущее
От: Aaron Brashears
Дата:
Сообщение: How to set numeric in PreparedStatement
Следующее
От: Chris Czeyka
Дата:
Сообщение: Lost in unicode?