ecpg help

Started by sid@questions.comalmost 24 years ago3 messagesgeneral
Jump to latest
#1sid@questions.com
sbhatt@installs.com

Hi,
I am trying to use preprocessor directives inside the declare statements but
its giving me compile time errors.
What i am do is something like this

EXEC SQL BEGIN DECLARE SECTION;
char myvar[NUM];
EXEC SQL END DECLARE SECTION;

#define NUM 20 is present in one of the include files.

Please help.
Vikas.

#2Michael Meskes
meskes@postgresql.org
In reply to: sid@questions.com (#1)
Re: ecpg help

On Thu, Jun 27, 2002 at 12:26:02PM -0400, sid@questions.com wrote:

I am trying to use preprocessor directives inside the declare statements but
its giving me compile time errors.
What i am do is something like this

EXEC SQL BEGIN DECLARE SECTION;
char myvar[NUM];
EXEC SQL END DECLARE SECTION;

#define NUM 20 is present in one of the include files.

Please use "EXEC SQL DEFINE NUM 20" to define NUM for ECPG. ECPG does
not parse CPP directives.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

#3Lee Kindness
lkindness@csl.co.uk
In reply to: sid@questions.com (#1)

Try this:

EXEC SQL DEFINE NUM 20
EXEC SQL BEGIN DECLARE SECTION;
char myvar[NUM];
EXEC SQL END DECLARE SECTION;

Regards, Lee Kindness.

sid@questions.com writes:

Show quoted text

I am trying to use preprocessor directives inside the declare statements but
its giving me compile time errors.
What i am do is something like this

EXEC SQL BEGIN DECLARE SECTION;
char myvar[NUM];
EXEC SQL END DECLARE SECTION;

#define NUM 20 is present in one of the include files.