Re: casting question

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "A(dot) Van Hook" <hook(at)kcp(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: casting question
Date: 2002-02-02 18:58:54
Message-ID: 20020202105619.E42811-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 2 Feb 2002, A. Van Hook wrote:

>
>
> I have a column (quantityonhand | character(15) | default '' )
> that I would like to use to perform simple math.
> I can't seem to get the syntax for casting and have tried various
> combinations of "select to_number(quantityonhand::text, '99G999D9S')".
> Can not get get past ERROR: Bad numeric input format ' '.
>
>
> Any help would be greatly appreciated....

You probably have a value in there which is not convertable to a numeric
(such as the default '').

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Murray Prior Hobbs 2002-02-04 10:32:09 temporary tables, plpgsql and yes i bet this has been asked before
Previous Message Steve Boyle (Roselink) 2002-02-02 16:38:15 Re: test the existence of a database