Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.21 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I cast a NUMBER value to a single CHAR in Oracle?
  2. char alpha = (char)123;
  3.        
  4. rank := 10;
  5. CAST(rank as CHAR(1))
  6.        
  7. TO_CHAR(rank,'99')
  8.        
  9. CAST(rank as CHAR(2))
  10.        
  11. SUBSTR(CAST(rank as CHAR(2)), 2, 1)