Type conversion

From: Ice Planet <ice(at)adiemus(dot)sk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Type conversion
Date: 2000-07-10 11:40:44
Message-ID: SAK.2000.07.10.cmmqekgq@adiemus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

I have one big select that computes some value. The value is in format numeric (40,4). Then is this value send to console and when someone on console agree with the number then is the number send to database where i need to do
something like this

select TheNumberFromConsole/(select max(division_point) from table1)

Division_point is in format numeric (40,4). But the number is sometimes small and sometimes big, when the number is big, then is all OK, but when the number is small i got error message that / for float8 (!) and numeric is not possible and i must
use explicit typecast, but i dont know how! I have look in manual, but there are informations about float8 only and at the bottom is written that most of functions for float8 works for numeric so i try:

select numeric (TheNumberFromConsole)/(select max(division_point) from table1)

But this don't work too...

Please help how should i written the statement correct.

Thanks for help and sorry for my bad english.

Best regards
Ice Planet

e-mail: ice(at)adiemus(dot)sk
ICQ#: 67765483

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ed 2000-07-10 13:18:44 Corruption... please help
Previous Message Holger Klawitter 2000-07-10 09:36:19 Re: Counting affected rows