I'm confused as to why I'm getting this error. I use a function that stores a NUMBER variable and returns a NUMBER (e.g. 123456).
I want to convert this to a format of my choosing, so I would use to_char:
select to_char(total_count_prods('apple'),'1234-56') from dual;
And I keep getting that error. What's the issue? If I run
select total_count_prods('apple') from dual;
Then I get the following output:
123456
How can I convert that to:
1234-56
You can use
SUBSTR:Or
REGEXP_REPLACE:Or, divide by 100 and use
TO_CHARand set the decimal separator to-:fiddle