hi.. i know little bit about the casting in java ie (from "float"to "int" or/etc) like wise my question is how the oracle converts the data in condition this is my sample query

branch -t
branch_bnk_code number3
branch_brn_code number3
branch_city_code number3

mybranch -t
mybranch_bnk_code varchar2
mybranch_brn_code varchar2
mybranch_loc_code varchar2

by this 2 tables

my query

select * from branch,mybranch
where branch_bnk_code = mybranch_bnk_code
and branch_brn_code = mybranch_brn_code

here which is type casted to which , what is the prioritised one whether the data type or the conditioned column (rignt column value or left column value) or the both.

and u can say u,i have to cast it by to_number.
i am using 11g, having the two hosts, one is running properly and another throwing excep
"invalid number"

thanks in advance.

Recommended Answers

All 5 Replies

If all the data contains number you can you to_number on the varchar field else use to_char on the number field.

thats ok....i did that.. but you did not given me the ans for my question.."the way of casting and preference "

Member Avatar

Casting, in Oracle, is usually implicit (It knows how to do it).
Sometimes, Oracle can NOT cast implicitly. You will have to cast explicitly.
Follow debasisdas's method.
And, yes... he did answer your question.

then can u give me the thing in the oracle implicit casting......

Member Avatar

Your request doesn't make any sense.
You do understand what "implicit" means, don't you?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.