Regarding boolean datatype

Поиск
Список
Период
Сортировка
От kanika singh
Тема Regarding boolean datatype
Дата
Msg-id 20021205091110.58690.qmail@web14512.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Regarding boolean datatype  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Hello all,

this is my first interaction with this list. I have a
problem. I was using MSSQL Server as db, now i m
changing to Postgres. I know that the bit type in
MSSQLserver is boolean in Postgres. 

So, i have the following query and getting the
following error:Why???

strSql    = " Update parts Set name = ? , description = ?
world_market = ?, part = ? , unit_of_measure = ? 
Where depot= ?;

prepStmt = conn.prepareStatement(strSql);
prepStmt.setString( 1, Pname) ;
prepStmt.setString( 2, Pdesc) ;
prepStmt.setBoolean(3, BoolWM) ;
prepStmt.setString( 4, strPart);
prepStmt.setString( 5, strUoM);
prepStmt.setString( 6, strDepot);

This is how i m assigning value to BoolWM,

boolean BoolWM ;if ( WM.equals("False")) {    BoolWM = false ; } else {    BoolWM = true; }

Error is:::

SQLError ERROR:  Unable to identify an operator '~~'
for types 'boolean' and 'unknown'
You will have to retype this query using an explicit
cast                        

I know, somewhere i m making mistake, but where??
Moreover, if i m updating the database with the above
query, the db is giving the error and deleting the
data from the db. As per my understanding it should
automatically rollback. What is the problem???

What are the other coding rules for Postgres??

Please guide.
Thanks and regards

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Ran out of connections
Следующее
От: Thrasher
Дата:
Сообщение: Re: Backend message type 0x50 arrived while idle