Re: Function to convert numeric string to number in version 8.0

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Gaudine <davidg(at)alcor(dot)concordia(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Function to convert numeric string to number in version 8.0
Date: 2006-03-09 22:35:04
Message-ID: 20060309223504.GB21716@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Mar 09, 2006 at 16:13:47 -0500,
David Gaudine <davidg(at)alcor(dot)concordia(dot)ca> wrote:
> Is there a function that will convert a numeric string to a number,
> returning zero if the string is empty?

You can use to_number to convert a string to a number. You can combine
that with a case statement to only convert strings that look like a number
and return zero for strings that don't look like a number.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message 王宝兵 2006-03-10 06:39:36 Re: Where Can I Find The Code Segment For WAL Control?
Previous Message David Gaudine 2006-03-09 21:13:47 Function to convert numeric string to number in version 8.0