CAST Problem: Difference between insert a tuple in a table by function and by datasheet - Mailing list pgsql-sql

From DI Hasenöhrl
Subject CAST Problem: Difference between insert a tuple in a table by function and by datasheet
Date
Msg-id 00b301c0fb14$e98b1da0$01011eac@irina
Whole thread Raw
List pgsql-sql
Now,I found the problem, but I don't know how to solve. It depends on type float8.
I changed all type float to float8
 
In my function I make the following calculation:
.............
update KalkPreislisten_float8 SET  kp_ep = rkontingent.k_ep::float8        -- this works correct
 
but I have to calculate with a numeric type too (rwaehrung.w_euro is numeric(9,5))
....................
update KalkPreislisten_float8 SET  kp_ep = rkontingent.k_ep::float8 *rwaehrung.w_euro::float8         -- this doesn't work
 
Please, can anyone tell me, how I must cast this numeric type to get float8
 
Many thanks in advance
Irina
                 

pgsql-sql by date:

Previous
From: "Richard Huxton"
Date:
Subject: Re: pl/pgsql question (functions)
Next
From: "Markus Bertheau"
Date:
Subject: select tbl1.attr1, number of tuples where tbl2.attr1=tbl1.attr1