Re: converting string value to integer

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Ken Guest <kguest(at)stockbyte(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: converting string value to integer
Date: 2002-12-18 13:30:36
Message-ID: kut00vg919igj5vmqtfi6g90ucfui4oo3b@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 18 Dec 2002 11:13:50 +0000, Ken Guest <kguest(at)stockbyte(dot)com>
wrote:
>How do I cast/convert a string value to an integer in 7.1.3?
>I've tried using cast but it doesn't seem to work.

fred=# SELECT version();
version
--------------------------------------------------------------
PostgreSQL 7.1.3 on i686-pc-cygwin, compiled by GCC 2.95.3-5
(1 row)

fred=# SELECT '123'::INT;
?column?
----------
123
(1 row)

fred=# SELECT CAST('123' AS INT);
?column?
----------
123
(1 row)

Does this answer your question? If not, show us an example of what
you have tried.

Servus
Manfred

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ken Guest 2002-12-18 13:51:28 Re: converting string value to integer
Previous Message Conxita Marín 2002-12-18 13:03:27 SELECT EXTRACT doesn't work with variables?