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

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 (view raw or flat)
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

pgsql-novice by date

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

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