libpq: Char to INT

From: Nelio Alves Pereira Filho <nelio(at)ifx(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq: Char to INT
Date: 2000-11-09 16:03:47
Message-ID: 3A0ACAE3.D7416B97@ifx.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there..

I want to do a query that returns an integer and then fetch the result
as an int. My query is something like that:

SELECT 1::int

Normally, I would get the result as a char and then convert it to int.
Until here, no misteries. However, 'The Programmer's Guide' shows an
example where a char pointer is converted to an int pointer, and then
it's used normally. I tried that, but the result wasn't correct..

Just to mention, I 'm used to convert char to int with strtol.

Thanks in advance.

Nelio Pereira
IFX Networks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-11-09 16:10:41 Re: need an information on PostgreSQL
Previous Message Tom Lane 2000-11-09 15:47:25 Re: upgrading to 7.0.2