Re: Cast char to number

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Christine Penner <christine(at)ingenioussoftware(dot)com>
Cc: Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cast char to number
Date: 2010-02-24 19:38:47
Message-ID: 20100224143847.604d7ef2.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Christine Penner <christine(at)ingenioussoftware(dot)com>:

> I have a character field I want to change to a number. The values in
> that field are all numbers that may or may not be padded with spaces
> or 0's. What is the best way to do that?

Put the values in numeric fields to begin with and cast to chars as
needed. Basically reverse what you're doing.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christine Penner 2010-02-24 19:53:42 Re: Cast char to number
Previous Message Christine Penner 2010-02-24 19:36:14 Cast char to number