Skip site navigation (1) Skip section navigation (2)

How to transform pg_7.4 function 'to_number' to 8.4 equivalent?

From: Ennio-Sr <nasr(dot)laili(at)tin(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?
Date: 2008-10-17 17:56:14
Message-ID: 20081017175614.GA12117@deby.ei.hnet (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi all,

after upgrading from pg_7.4 to pg_8.3  when I run this command:

psql finanza -c "SELECT titolo, var, pr_chius, pr_aper, \
diff_aper_ch*(-1) as \"diff. ass.\", \
to_number(diff_aper_ch*(-1)/pr_aper*100::float(8),'9999.000000') as \"sc. %\" \
from ult_qq having pr_chius>pr_aper and pr_aper>0 \
order by titolo;"   | tee -a /home/ennio/.tmp/aaa

I get:

ERROR: function to_number(double precision, unknown) does not exist ...

Of course it worked very well under 7.4 ...

Can somebody suggest how to correct this?


[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.    \\?//
 Fa' qualche cosa di cui non sei capace!"   (diceva Henry Miller) ]    (°|°)
 Ricevo solo messaggi Content-Type: plain/text (no html o multipart).   )=(
 !!! --> e-mail a mio nome via OE (M$) sono false  e infette <-- !!!


pgsql-novice by date

Next:From: Morris, RoyDate: 2008-10-17 18:26:02
Subject: Re: How to transform pg_7.4 function 'to_number' to 8.4 equivalent?
Previous:From: Stefan MurphyDate: 2008-10-17 17:43:04
Subject: Re: "timestamp without timezone" and at "time zone"

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group