View the Exhibit and examine the structure and data in the INVOICE table.
Which statements are true regarding data type conversion in expressions used in queries?
(Choose all that apply.)
A.
inv_amt =’0255982′ : requires explicit conversion
B.
inv_date > ’01-02-2008′ : uses implicit conversion
C.
CONCAT(inv_amt,inv_date) : requires explicit conversion
D.
inv_date = ’15-february-2008′ : uses implicit conversion
E.
inv_no BETWEEN ‘101’ AND ‘110’ : uses implicit conversion
Explanation:
In some cases, the Oracle server receives data of one data type where it expects data of a
different data type.
When this happens, the Oracle server can automatically convert the data to the expected data
type. This data type conversion can be done implicitly by the Oracle server or explicitly by the
user.
Explicit data type conversions are performed by using the conversion functions. Conversion
functions convert a value from one data type to another. Generally, the form of the function names
follows the convention data type TO data type. The first data type is the input data type and the
second data type is the output.
Note: Although implicit data type conversion is available, it is recommended that you do the
explicit data type conversion to ensure the reliability of your SQL statements.
My question
E is right, because inv_no is not null?
I could explain that this question refers to?
Thank you very much!!
Why this statement:
inv_date = ’15-february-2008′ : uses implicit conversion
Is right and this:
inv_date > ’01-02-2008′ : uses implicit conversion
It´s not?
Both use inv_date and need a conversion to make the equal or major operator.. ??
Because ’15-february-2008′ is recognized as ’15-FEB-08′ using implicit conversion because it recognizes February being the same as FEB.
However this: ’01-02-2008′ can not be recognized as a date without a conversion mask, and in fact will give you an error on runtime ie. 02 has nothing to do with FEB in the Oracle interpreter. You and I know it is the same but Oracle does not unless it is told. You need to do this: to_date(’01-02-08′, ‘DD-MM-RR’)
could someone explain E ?
which data type need explicit conversion
which data type implicitlly converted which is not and why?