Belajar Cast Function di Oracle
TO | FROM | |||||
---|---|---|---|---|---|---|
char, varchar2 | number | datetime / interval | raw | rowid, urowid | nchar, nvarchar2 | |
char, varchar2 | X | X | X | X | X | |
number | X | X | ||||
datetime / interval | X | X | ||||
raw | X | X | ||||
rowid, urowid | X | X | ||||
nchar, nvarchar2 | X | X | X | X | X |
Tabel di atas menunjukan 'cast' yang bisa di lakukan di oracle. Bagaimana caranya melakukan casting, bisa di lihat / di pelajari langsung di www.java2s.com, berikut daftar link yang bisa di jadikan referensinya :
15. 10. 1. | cast(12.98 as number(2)) example1 | |||
15. 10. 2. | select cast('oak' as char(10) ) example2 | |||
15. 10. 3. | select cast(null as date ) example3 | |||
15. 10. 4. | Cast string to date type before comparison | |||
15. 10. 5. | Cast null as timestamp | |||
15. 10. 6. | Cast table of numbers | |||
15. 10. 7. | Cast number to a char | |||
15. 10. 8. | Cast date to char | |||
15. 10. 9. | Cast decimal to integer | |||
15. 10. 10. | Cast varchar to char | |||
15. 10. 11. | CAST examples | |||
15. 10. 12. | Use Date to cast string to date type |