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!

ORA-01722:invalid Number when Querying a View

921311Jun 2 2013 — edited Jun 3 2013
Hi,

I have a view A_VIEW which has condition:

a.organization_id = itm.object1_id2
AND a.inventory_item_id = itm.object1_id1

a is the alias for table mtl_system_items_b
and b is the table for okc_k_items

When i querying the View select * from a_view where a.segment1 like '%ABC%' its throwing Error as ORA-01722:invalid Number.I found that some of the records in the table okc_k_items object1_id2 has values such as 102#.I tried in sloving the above condition as:

to_char(a.organization_id) = itm.object1_id2
AND to_char(a.inventory_item_id) = itm.object1_id1 and the Error got rectified.But doing the performance got hampered.

Is there any wayout to configure the Query of the View either by using Hints or someway so that when a varchar2 joined with number it will not throw Error.I am using oracle database 11g

Any help will be needful for me as its affecting business for some particular condition

Thanks and Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2013
Added on Jun 2 2013
5 comments
3,008 views