Regarding boolean datatype

From: kanika singh <kanikasingh20(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Regarding boolean datatype
Date: 2002-12-05 09:11:10
Message-ID: 20021205091110.58690.qmail@web14512.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thrasher 2002-12-05 09:27:48 Re: Backend message type 0x50 arrived while idle
Previous Message Steve Crawford 2002-12-05 00:25:55 Re: Ran out of connections