Re: [despammed] converting varchar to integer - Mailing list pgsql-sql

From Frank Bax
Subject Re: [despammed] converting varchar to integer
Date
Msg-id 5.2.1.1.0.20050817124436.02d4c970@pop6.sympatico.ca
Whole thread Raw
In response to Re: [despammed] converting varchar to integer  (Kretschmer Andreas <andreas_kretschmer@despammed.com>)
Responses Re: [despammed] converting varchar to integer
List pgsql-sql
At 05:30 AM 8/17/05, Kretschmer Andreas wrote:

>tv@fuzzy.cz <tv@fuzzy.cz> schrieb:
>
> > Hi,
> >
> >    I have a varchar column, and I need to
> >
> >    1) check the value in it is an integer
> >    2) get the integer value (as integer)
>
>test=# update foo set n = substring(t , '[0-9]')::int;


I think you meant:        update foo set n = substring(t , '[0-9]+')::int;



pgsql-sql by date:

Previous
From: Halley Pacheco de Oliveira
Date:
Subject: Re: converting varchar to integer
Next
From: "Lane Van Ingen"
Date:
Subject: Is it This Join Condition Do-Able?