Re: c/sql

Lists: pgsql-hackers
From: ozsevim(at)likya(dot)iyte(dot)edu(dot)tr
To: pgsql-hackers(at)postgresql(dot)org
Subject: c/sql
Date: 102-11-07 22:44:25
Message-ID: 200211072044.WAA08918@likya.iyte.edu.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: ozsevim(at)likya(dot)iyte(dot)edu(dot)tr
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: c/sql
Date: 2002-11-10 17:51:17
Message-ID: 20021110175117.GE17067@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Nov 07, 2002 at 10:44:25PM +0000, ozsevim(at)likya(dot)iyte(dot)edu(dot)tr wrote:
> 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,

You should have no problem finding some docs about "embedded SQL" using
google or a similar search engine. As for PostgreSQL check the docs
about ecpg. There are also some examples in the source tree.

Michael
--
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


From: jsedwards(at)acm(dot)org (Jeff Edwards)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: c/sql
Date: 2002-11-14 22:40:23
Message-ID: 3a1ba690.0211141440.415c1a2c@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ozsevim(at)likya(dot)iyte(dot)edu(dot)tr wrote in message news:<200211072044(dot)WAA08918(at)likya(dot)iyte(dot)edu(dot)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