Re: c/sql - Mailing list pgsql-hackers

From jsedwards@acm.org (Jeff Edwards)
Subject Re: c/sql
Date
Msg-id 3a1ba690.0211141440.415c1a2c@posting.google.com
Whole thread Raw
In response to c/sql  (ozsevim@likya.iyte.edu.tr)
List pgsql-hackers
ozsevim@likya.iyte.edu.tr wrote in message news:<200211072044.WAA08918@likya.iyte.edu.tr>...
> Hello,
> I know Ansi C language and SQL.  I want to embed a sql statement into a c 
> source code. Would you please recommend me some web sites or tutorials 
> regarding this subject.
> Thank you for your concern,
> Emrah
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

Hi,
You need to read about the possible interfaces for postgreSQL.
I've used the libpq++ for my C++ classes with great success.
So, #include <libpq++.h> and embed the sql with sprintf(x,sql)
then send x to the server with if(!ExecCommandOk(x)) printf("Error...");

Good luck,
Jeff


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: create or replace view
Next
From: Tara Piorkowski
Date:
Subject: Re: [GENERAL] PostgreSQL v7.3b5 Packaged for Testing ...