Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Havy SQL

Havy SQL

From: Wind.Dancer <wind.dancer_at_hotmail.com>
Date: 20 Apr 2006 01:08:41 -0700
Message-ID: <1145520521.216999.178520@g10g2000cwb.googlegroups.com>


My Sql is

SELECT 'x3y2q1__q1',

          partition_name
    FROM all_tab_partitions
    where (SYSDATE - TO_DATE(SUBSTR(partition_name,-8,8),'YYYYMMDD')) > 186

    and UPPER(partition_name)  not like  '%CUR'
    AND UPPER(table_name)  = UPPER('A1_MSC_TERMINATION_D')
    AND UPPER(table_owner) = UPPER('bus')
      ;


If I run it I got
[1]: (Error): ORA-01841: (full) year must be between -4713 and +9999, and not be 0

Because it executes the
where (SYSDATE - TO_DATE(SUBSTR(partition_name,-8,8),'YYYYMMDD')) > 186 before the
and UPPER(partition_name) not like '%CUR'

Any Ideas

thx in advanced Received on Thu Apr 20 2006 - 03:08:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US