Skip site navigation (1) Skip section navigation (2)

ECPG and structure declaration

From: Jürgen Cappel <email(at)juergen-cappel(dot)de>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: ECPG and structure declaration
Date: 2003-09-21 06:46:02
Message-ID: JEEKIPNAKJNCFLMOBKHGKEFGDBAA.email@juergen-cappel.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
ECPG and structure declaration

Hello,

why is the following code fragment an error for ecpg ?

---------------------------------------------
EXEC SQL BEGIN DECLARE SECTION;
struct base
{
    char  basekey [ 26 ];
};
EXEC SQL END DECLARE SECTION;

struct base b1[10];
struct base *b2;
---------------------------------------------

ecpg gives the error message:
demo.q:5: ERROR: syntax error at or near ";"

Versions:
- ecpg (PostgreSQL 7.3.3) 2.10.0
- Linux scaleo 2.4.18-4GB #1 Wed Mar 27 13:57:05 UTC 2002 i686 unknown

My intention is to declare the structure type in an include file and
define arrays, pointers, etc from the declaration in various .c files.

What's wrong ?

Cheers,

Jürgen


Responses

pgsql-interfaces by date

Next:From: Dave PageDate: 2003-09-21 10:26:58
Subject: Re: Killing the backend to cancel a long waiting query
Previous:From: Christopher Kings-LynneDate: 2003-09-21 06:25:16
Subject: Re: Killing the backend to cancel a long waiting query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group