pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashok Chauhan <ashok@kalculate.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: error in code
Date: 10 Dec 2003 10:56:01 +0530
Message-ID: <1071033961.1264.7.camel@chi> (raw)


****************************
# 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



view thread (4+ messages)  latest in thread

Message-ID: <1071033961.1264.7.camel@chi>
Permalink:  ../1071033961.1264.7.camel@chi/
Also on:    postgresql.org/message-id/1071033961.1264.7.camel@chi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: ashok@kalculate.com
  Subject: Re: error in code
  In-Reply-To: <1071033961.1264.7.camel@chi>
  References: <1071033961.1264.7.camel@chi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox