August 31, 2005 at 11:55 am
Hi,
Any thoughts as to why these statements produce the same results (38 rows returned)? This does not work in Oracle re: passing a int datatype as a string?
USE northwind
select * from "order details"
where productid = '11'
select * from "order details"
where productid = 11
... and for money datatype these are not the same ...
USE northwind
select * from "order details"
where unitprice = 14
select * from "order details"
where unitprice = '14'
Many thanks. Jeff
August 31, 2005 at 11:57 am
Check the execution plans when doing that. You'll see it doesn't actually always work (well anyways).
August 31, 2005 at 12:00 pm
Automatic data type conversion. Certain datatypes are automatically casted when you have a comparison using two different types.
August 31, 2005 at 1:14 pm
There's a chart of which data types are converted implicitly, which require explicit conversion, and which are not allowed in Books Online. Look for Cast and Convert.
August 31, 2005 at 1:21 pm
Cast or Convert could be an issue but the main reason there is no INT datatype in Oracle, it uses NUMBER for all numeric data types including DOULBE that is not used in SQL Server. Hope this helps.
Kind regards,
Gift Peddie
Kind regards,
Gift Peddie
September 2, 2005 at 8:33 am
Great.
Many thanks. Jeff
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply