Re: Testing embedded SQL in C

From: Shane Ambler <pgsql(at)007Marketing(dot)com>
To: HT NB <hbnt(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Testing embedded SQL in C
Date: 2007-02-13 09:13:01
Message-ID: 45D1811D.9010807@007Marketing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

HT NB wrote:
> Hi,
>
> How are you doing?
>
> First, I am testing if this email address is valid. It is the first time that I
> am using this account. I have a question about how to start write embedded SQL
> in C programming code. What are the basic requirements in the .pgc file to have
> the embedded SQL running.
>
> This is my coding which is aimed at testing if embedded SQL in C programming
> code is possible for my operating system Debian GNU/Linux.
>
> #include <stdio.h>
>
>
> int main ( )
> {
>
> EXEC SQL CONNECT TO database(at)sql(dot){ip address}.com <mailto:database(at)sql(dot){ip
> address}.com> :80;

try -
EXEC SQL CONNECT TO database(at){ip address}:5432 USER mylogin;

The one thing from your code I would question is your specifying port
80. That is the port for a web server not postgresql. Can you access the
postgresql server directly or are you trying to get to it through a web
server? If you are going through the web server then embedded sql won't
work, you will need to deal with http requests and responses.

> EXEC SQL INSERT INTO database (tab_number) VALUES (4);
> EXEC SQL SELECT * FROM database;
>
> return 1;
>
> }
>

--

Shane Ambler
pgSQL(at)007Marketing(dot)com

Get Sheeky @ http://Sheeky.Biz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2007-02-13 09:23:43 Re: How to append tables in a view
Previous Message Alban Hertroys 2007-02-13 09:05:45 Re: Adjacency List or Nested Sets to model file system hierarchy?