PL/SQL (MOSC)

MOSC Banner

ORA-01722

edited Nov 13, 2012 2:24AM in PL/SQL (MOSC) 6 commentsAnswered
 Hi All,
we have a query like below.
while this query is working fine on one database it is getting ORA-01722 (red piece) on another database. nls_parameters are same both database. What could be the problem  ?  

Regards.

select distinct 0 as c1,
     D1.c2 as c2,
     D1.c1 as c3
from 
     (select count(1) as c1,
               TRUNC((TO_NUMBER(TO_CHAR(sysdate, 'DDD'), '999') - TO_NUMBER(TO_CHAR(sysdate, 'D'), '99') + 13) / 7) as c2
          from 
               dual
          group by TRUNC((TO_NUMBER(TO_CHAR(sysdate, 'DDD'), '999') - TO_NUMBER(TO_CHAR(sysdate, 'D'), '99') + 13) / 7)
     ) D1
order by c2

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center