Pro *C question

From: Jeffrey Pickett <jdp_at_pittslug.sug.org>
Date: 28 May 93 21:36:13 GMT
Message-ID: <19813_at_pitt.UUCP>


I am writing a C program with embedded SQL that has several subroutines. What I need to know is, do host variables have to be global? In every example I have seen they are.

I have a block of code that looks like so:

EXEC SQL BEGIN USER DECLARATION;

	VARCHAR userid;
	VARCHAR password;
	char *sql_stmt;

EXEC SQL END USER DECLARATION; Now when I make this section global, everything works just fine, but if I put this section in the main function, it won't work. It appears that when I make this declaration, Pro*C puts its own variables in the C code. These Pro*C variables are needed in some of my subroutines, but since I made the declaration local, the subroutines can't see them.

Is the answer that this declaration must be global? I am very puzzled.

Jeff Confused Received on Fri May 28 1993 - 23:36:13 CEST

Original text of this message