pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ice Planet <ice@adiemus.sk>
To: pgsql-sql@postgresql.org
Subject: Type conversion
Date: Mon, 10 Jul 2000 13:40:44 +0200
Message-ID: <SAK.2000.07.10.cmmqekgq@adiemus> (raw)

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@adiemus.sk
ICQ#: 67765483





view thread (8+ messages)  latest in thread

Message-ID: <SAK.2000.07.10.cmmqekgq@adiemus>
Permalink:  ../SAK.2000.07.10.cmmqekgq@adiemus/
Also on:    postgresql.org/message-id/SAK.2000.07.10.cmmqekgq@adiemus

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ice@adiemus.sk
  Subject: Re: Type conversion
  In-Reply-To: <SAK.2000.07.10.cmmqekgq@adiemus>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox