Skip site navigation (1) Skip section navigation (2)

Re: troubles with getting data from tables

From: Roman Bogorodskiy <bogorodskiy(at)inbox(dot)ru>
To: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: troubles with getting data from tables
Date: 2003-09-24 03:18:41
Message-ID: 20030924071841.6e33c20d.bogorodskiy@inbox.ru (view raw or flat)
Thread:
Lists: 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-----

In response to

pgsql-interfaces by date

Next:From: Michael MeskesDate: 2003-09-24 07:25:42
Subject: Re: ECPG insert into table name as a variable
Previous:From: Igor ShevchenkoDate: 2003-09-23 23:19:46
Subject: Re: libpq: how to get a sequence of partial PGresult-s

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group