0

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.

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by hfx642
0

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

0

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

0

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.

Edited by hfx642: n/a

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.