pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kanika singh <kanikasingh20@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Regarding boolean datatype
Date: Thu, 5 Dec 2002 01:11:10 -0800 (PST)
Message-ID: <20021205091110.58690.qmail@web14512.mail.yahoo.com> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <20021205091110.58690.qmail@web14512.mail.yahoo.com>
Permalink:  ../20021205091110.58690.qmail@web14512.mail.yahoo.com/
Also on:    postgresql.org/message-id/20021205091110.58690.qmail@web14512.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kanikasingh20@yahoo.com
  Subject: Re: Regarding boolean datatype
  In-Reply-To: <20021205091110.58690.qmail@web14512.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox