I've condensed my problem into a very simple procedure. Here is the procedure:
CREATE OR REPLACE PROCEDURE test IS
iunique := 1330 ;
vfive := to_char(iunique,'0009') ;
vfour:= to_char(iunique,'0009') ;
When I execute this procedure, I get a 6502 error on the line using the to_char function with vfour. The to_char line with vfive gives no error.
As I interpret things, I am converting a four-digit integer value to characters. This should give me a four-character result.
Shouldn't the four-character result fit in a four-character field?
Any explanations as to why I'm getting the 6502 error when I'm trying to put the result in a four-character field, but no error when I put the result in a five character field?
(We're using Oracle 11g by the way)