Re: troubles with getting data from tables - Mailing list pgsql-interfaces

From Roman Bogorodskiy
Subject Re: troubles with getting data from tables
Date
Msg-id 20030924071841.6e33c20d.bogorodskiy@inbox.ru
Whole thread Raw
In response to Re: troubles with getting data from tables  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-interfaces
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jeroen wrote:

> First off, a question: why don't you just select the field you want,
> so you know its index in the result set?  That'll probably transport
> less data, save you that PQfnumber() call, and make your code shorter
> and more readable.

I'm new to libpq programming, so...

> The pointer you're getting is a pointer-to-char, i.e. a string. 
> Unless you explicitly enabled the "binary tuples" option, what you're
> getting is exactly that: a string.  But instead of parsing the string,
> you're casting its base pointer to pointer-to-int!

Thank you fo answer, it realy helped me. 

- -Roman Bogorodskiy [Novel]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iQEVAwUBP3ENESpMDQ8aPhy0AQKvNQf/RcCNMoCDQiTeCBecZ5XcI1IS3QVfReiN
UuvPD54081AZNtLq2H+Ux7XRHeacwaSDna2l5oXLZCrVsmbrD8XdzbZoK/CB0Ry0
j8ansMkFJmhaB2FGiK/7UG7Ov82qGi6Q3vMxVWZajmSd00qafs442/RT4+KJsVvy
r4PHvHoTDRHmh/PAMFfXABHJE5eub9D9NmL6ETp0HDCHMvVa26nUpProPkZF6Wz9
GyKcVOEU7xgKyoFsr6Zr/o6qXfNYtAjttewzrMXjTkwtN51EJnOA0gHXjlrKt3TU
yiiM+J2euk6V/90qCvGvZc4trw49Sno2rpWI4JfReu3AECaEWIAe2g==
=7SKo
-----END PGP SIGNATURE-----


pgsql-interfaces by date:

Previous
From: Igor Shevchenko
Date:
Subject: Re: libpq: how to get a sequence of partial PGresult-s
Next
From: Michael Meskes
Date:
Subject: Re: ECPG insert into table name as a variable