Re: Problem using PQgetvalue()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: MicazMAK <emoazzam(at)yahoo(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Problem using PQgetvalue()
Date: 2007-04-29 17:03:13
Message-ID: 24473.1177866193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

MicazMAK <emoazzam(at)yahoo(dot)com> writes:
> Hi I am using PQgetvalue() function in c to get the value of a field like
> PQgetvalue(result,0,2)
> but the program outputs following
> "column number 2 is out of range 0..0"

> Can someone tell me how can I get this field and whats wrong?

Your result doesn't actually have three columns --- apparently it
has just one. Better check which query you were issuing.

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Maphin Philip 2007-05-01 11:25:05 postgres and c
Previous Message MicazMAK 2007-04-29 16:22:17 Problem using PQgetvalue()