I am using Oracle SQL database and I have to insert a monetary value(salary) as part of a row. For some strange reason the money command isnt working, is there any alternate
Look at this line
salary MONEY NOT NULL
There is no existing money datatype.
If you are looking for something similar to SQL-Server
small money type, you want to use a Number(10,4)
and then format the number.
You can format the number using to_char
function
select to_char(yourColumn, '$99,999.99') from yourTable where someCondition
The "strange" reason is simple: There is no MONEY data type.
The data type most appropriate for monetary values would be NUMBER (using an appropriate scale). Since it is a decimal floating-point type, it is better suited for monetary values than the binary floating-point types BINARY_FLOAT
and BINARY_DOUBLE
.
Note, though, that you will still need to parse the input string £00,000.000
in your front end and send it as a numeric value to the back end.