From: | Ashok Chauhan <ashok(at)kalculate(dot)com> |
---|---|
To: | pgsql-admin <pgsql-admin(at)postgresql(dot)org> |
Subject: | error in code |
Date: | 2003-12-10 05:26:01 |
Message-ID: | 1071033961.1264.7.camel@chi |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
****************************
# include <stdio.h>
# include <stdlib.h>
# include <libpq-fe.h>
int main()
{
PGresult *result;
PGconn *conn;
int feild;
printf("successful");
conn = PQconnectdb ("ashok");
result = PQexec (conn, "select * from bill");
feild = PQntuples (result);
printf("%d",feild);
PQclear (result);
PQfinish (conn);
printf("hello");
return 1;
}
I written a code and compile with following command, it complied and
create 'a.out' file but when i run the a.out it give nothing.
command:- "gcc program.c -I /usr/include/pgsql/include -L
/usr/lib/libpq.a -lpq"
plz help me.
Ashok
From | Date | Subject | |
---|---|---|---|
Next Message | Sai Hertz And Control Systems | 2003-12-10 06:32:01 | Re: Upgrading from 7.2.4 (RH 8) to 7.4 (RH9) |
Previous Message | Uwe C. Schroeder | 2003-12-10 05:08:12 | Re: Running Postgres Daemons with same data files |