dbTalk Databases Forums  

null value of type java.sql.Time

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss null value of type java.sql.Time in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Hallgren
 
Posts: n/a

Default Re: null value of type java.sql.Time - 11-22-2004 , 05:06 PM






phil campaigne wrote:
Quote:
Occasionally I want to store a null value for my java.sql.Time--> Time
column in Postgresql.
update event set game_clock=null where event_id=1;

I can retreive the record with the null value (type Time) if I select on
the primary key,
select game_clock from event where event_id = 1;

but when I try to select on the null column value, I get zero records.
select * from event where game_clock=null;

Try
select * from event where game_clock is null;

A null value cannot be used in a comparison since it's undefined. You
have to explicitly query for something that has no value, hence the
different syntax.

Regards,
Thomas Hallgren


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #2  
Old   
Gregory S. Williamson
 
Posts: n/a

Default Re: null value of type java.sql.Time - 11-22-2004 , 06:39 PM






Try:
SELECT * FROM event WHERE game_clock IS NULL;

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From: phil campaigne [mailtocampaigne (AT) charter (DOT) net]
Sent: Monday, November 22, 2004 2:33 PM
To: pgsql-general (AT) postgresql (DOT) org
Subject: [GENERAL] null value of type java.sql.Time


Occasionally I want to store a null value for my java.sql.Time--> Time
column in Postgresql.
update event set game_clock=null where event_id=1;

I can retreive the record with the null value (type Time) if I select
on the primary key,
select game_clock from event where event_id = 1;

but when I try to select on the null column value, I get zero records.
select * from event where game_clock=null;

How can I retreive records with null values for a column?
thanks,
Phil



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #3  
Old   
Net Virtual Mailing Lists
 
Posts: n/a

Default Re: null value of type java.sql.Time - 11-23-2004 , 04:41 AM



Try:

select * from event where game_clock IS NULL


- Greg

Quote:
Occasionally I want to store a null value for my java.sql.Time--> Time
column in Postgresql.
update event set game_clock=null where event_id=1;

I can retreive the record with the null value (type Time) if I select
on the primary key,
select game_clock from event where event_id = 1;

but when I try to select on the null column value, I get zero records.
select * from event where game_clock=null;

How can I retreive records with null values for a column?
thanks,
Phil


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #4  
Old   
phil campaigne
 
Posts: n/a

Default null value of type java.sql.Time - 11-23-2004 , 10:15 AM



Thanks for the insight Thomas and Gregory. I think I can make a work
around.
Phil


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.