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

Select statement error !!!!

From: "Vutharkar Goutham" <goutham4u(at)hotmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Select statement error !!!!
Date: 2003-09-24 10:27:04
Message-ID: Sea1-F17prhMOgRGkQ600000446@hotmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
Hello,

I am doing a simple program with PostgreSql wherein i am giving a select 
statement as an argument to PQexec like this


char query[1024];
strcpy(query,"Select * from Udp_Table");

res = PQexec(conn,query);

if(!res || PQresultStatus(res)! = PGRES_COMMAND_OK)
{
	fprintf(stderr,"Select Failed.\n");
	PQclear(res);
	exit(1);
}
now if i try to execute the above statement it is giving me always teh 
select failed message. I dont know where the problem is? But when i try to 
store some other query in array like update statement or insert statement or 
any other statement it is working and giving the results i want to see. But 
i dont know what is wrong with the select statement i think it should work 
isn't it? Can anybody out there please help me to solve this problem.

Thank You,

Goutham.V
  MSIT.

_________________________________________________________________
Get personal loans. It's hassle-free. 
http://server1.msn.co.in/msnleads/citibankpersonalloan/citibankploanjuly03.asp?type=txt 
It's approved instantly.


Responses

pgsql-docs by date

Next:From: Oliver ElphickDate: 2003-09-24 11:00:49
Subject: Re: Select statement error !!!!
Previous:From: Tom LaneDate: 2003-09-19 16:09:40
Subject: Re: About SET SEARCH_PATH

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