Re: Datatypes in embedded SQL

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Mic <Mic(dot)c(at)sloten(dot)demon(dot)nl>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Datatypes in embedded SQL
Date: 2001-03-28 06:51:58
Message-ID: 20010328085158.B8183@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Mon, Mar 26, 2001 at 08:35:05PM +0200, Mic wrote:
> Thing is, I'm trying to declare a struct in the embedded SQL part in my C
> program, but the preprocessor complains about an 'unknown data type in line
> 162'. Is it not possible at all in Postgres to declare a structure? I tried

Which data type are you using? It is possible to declare a struct inside
the declare section.

> writing out the DBstruct in the SQL DECLARE section, that didn't work
> either.

You have to write it out there or else the statement using the struct won't
work because the preproc never saw the definition.

> typedef struct {
> int line_nr,
> type;
> char nick[10],
> line[161];
> } DBstruct;

That won't work. ECPG will not see this part of the code. Did you try the
latest CVS version aka PostgreSQL 7.1?

Michael

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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Takehiko Abe 2001-03-28 10:20:54 Re: Libpq for the MacOS (2)
Previous Message dhninh 2001-03-28 03:59:34 connect to MS SQL server