Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getting ORA-01722: invalid number

venkatraman.LMar 14 2012 — edited Mar 14 2012
Hello,

SELECT * from table t where
t.origin ='DXB' and t.destn ='BLR'
(trim(t.dow) is null or INSTR(t.dow, to_char('11-JUL-2011'-1,'D')) > 0);

Above SQL executes successfully.But when i try the same with different date value it throws ORA-01722:invalid number error.Below is the failed SQL.

SELECT * from table t where
t.origin ='BKG' and t.destn ='DXB'
(trim(t.dow) is null or INSTR(t.dow, to_char('29-JUN-2011'-1,'D')) > 0);


DOW is varchar column.
Oracle version:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit

Please suggest.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2012
Added on Mar 14 2012
10 comments
1,960 views