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



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to