Hi I'm doing a dimensional modeling exercise in college and I'm trying to convert the total_price
entry in two of the database tables to euro so they will be in the dimensional table as euro. The two tables are tournament1
and tournament2
and the dimensional table is dim_tournament
. Here is the code I am trying to run:
insert into Dim_tournament (Tournament_SK, total_price, Tournament_DESC)
Select
seq_Tournament.nextVal,
total_price,
t_descriprion
From (
select
t_id,
cast(to_char(total_price, 'C9,999,999.00')as integer),
t_descriprion
from Tournament1
union all
select
t_id,
cast(to_char(total_price, 'C9,999,999.00')as integer),
t_descriprion from Tournament2
);
This is the error I keep getting when running this:
Error report -
SQL Error: ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause: The specified number was invalid.
*Action: Specify a valid number.
Any help would be very much appreciated.
total_price
to a currency string ("$5.99"). If that is true then the currency symbol is probably your problem.Select seq_Tournament.nextVal, total_price, t_descriprion From ( select t_id, cast(to_char(total_price, 'C9,999,999.00')as integer), t_descriprion from Tournament1 union all select t_id, cast(to_char(total_price, 'C9,999,999.00')as integer), t_descriprion from Tournament2 );