RE: Sql Oddity

  • From: "Sweetser, Joe" <JSweetser@xxxxxxxx>
  • To: <eugene.pipko@xxxxxxxxxxxx>, <Richard.Goulet@xxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 18 Jan 2010 13:44:39 -0700

I get in 1 in 9.2.0.6 on RH Linux.

 

-joe

 

oracle@gale$ sqlplus <user>/<pass>

 

SQL*Plus: Release 9.2.0.6.0 - Production on Mon Jan 18 13:42:06 2010

 

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

 

SQL> create table test_date_drop_me (test_column timestamp default
sysdate);

 

Table created.

 

SQL> insert into test_date_drop_me values (sysdate);

 

1 row created.

 

SQL> select CASE WHEN systimestamp> t.test_column THEN 1 ELSE 0 END from
test_date_drop_me t;

 

CASEWHENSYSTIMESTAMP>T.TEST_COLUMNTHEN1ELSE0END

-----------------------------------------------

                                              1

 

SQL> drop table test_date_drop_me;

 

Table dropped.

 

SQL>

 

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Eugene Pipko
Sent: Monday, January 18, 2010 1:36 PM
To: 'Richard.Goulet@xxxxxxxxxxx'; 'oracle-l@xxxxxxxxxxxxx'
Subject: RE: Sql Oddity

 

Dick,

 

I get 1 in 9.2.0.8 and 9.2.0.5

 

Eugene Pipko

Seattle Pacific Industries

office: 253.872.5243

cell: 206.304.7726

P  Please consider the environment before printing this e-mail

 

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Goulet, Richard
Sent: Monday, January 18, 2010 12:26 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Sql Oddity

 

Folks, 

        Anyone ever seen this:  A developer executes the following code
in an Oracle 9i database (9.2.0.6) 

create table test_date_drop_me (test_column timestamp default sysdate); 
        
insert into test_date_drop_me values (sysdate); 
        
select CASE WHEN systimestamp> t.test_column THEN 1 ELSE 0 END from
test_date_drop_me t; 

He gets a 0 each time the final select statement is excecuted no matter
what the value in the table.  In a 10.2.0.4 and 11.1.0.7 database we get
a 1.  Any ideas???

Dick Goulet 
Senior Oracle DBA/NA Team Lead 
PAREXEL International 
900 Chelmsford St, Suite 310 
Lowell, MA 01821 
978.614.2857 
Richard.Goulet@xxxxxxxxxxx 

The information transmitted in this communication is intended only for
the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please destroy
any copies, contact the sender and delete the material from any
computer.

 

Other related posts: