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

Home -> Community -> Usenet -> c.d.o.server -> Re: Query gives incorrect results

Re: Query gives incorrect results

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Tue, 03 Jun 2003 14:27:34 GMT
Message-ID: <qf2Da.30573$DV.54039@rwcrnsc52.ops.asp.att.net>


And you don't consider using 2 digit years in your code to be a bug. Guess someone didn't learn much in this last century. Jim

-- 
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Edzard" <edzard_at_volcanomail.com> wrote in message
news:5d75e934.0306030623.61e1feab_at_posting.google.com...

> After migration of a Oracle7 database to 9iDB version 9.2.0.3, some
> queries appear to "no longer work".
>
> SELECT o.object_name
> , o.created
> , pk.name
> FROM dba_dependencies ap
> , dba_dependencies pk
> , dba_objects o
> WHERE o.owner = 'SYS'
> AND o.created BETWEEN
> TO_DATE('01-01-'||SUBSTR('2001',3,2),'DD-MM-YY')
> AND
> TO_DATE('31-12-'||SUBSTR('2003',3,2),'DD-MM-YY')
> AND ap.referenced_type = o.object_type
> AND ap.referenced_name = o.object_name
> AND ap.owner = 'SYS'
> AND pk.referenced_type = ap.type
> AND pk.referenced_name = ap.name
> AND pk.owner = 'SYS'
> AND rownum < 10
> /
>
> In my database this query returns no rows.
>
> Now add just seven spaces after the word WHERE:
>
> SELECT o.object_name
> , o.created
> , pk.name
> FROM dba_dependencies ap
> , dba_dependencies pk
> , dba_objects o
> WHERE o.owner = 'SYS'
> AND o.created BETWEEN
> TO_DATE('01-01-'||SUBSTR('2001',3,2),'DD-MM-YY')
> AND
> TO_DATE('31-12-'||SUBSTR('2003',3,2),'DD-MM-YY')
> AND ap.referenced_type = o.object_type
> AND ap.referenced_name = o.object_name
> AND ap.owner = 'SYS'
> AND pk.referenced_type = ap.type
> AND pk.referenced_name = ap.name
> AND pk.owner = 'SYS'
> AND rownum < 10
> /
>
> Now the query returns rows.
>
> This problem is reported to Oracle and considered a bug. I mention it
> here as the Oracle bugnr is not publicly visible (2977019).
>
> Generally the migration was succesful and I ran in only three queries
> that gave wrong results (in a large set of buggy reports)
Received on Tue Jun 03 2003 - 09:27:34 CDT

Original text of this message

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