On Thu, Jun 14, 2001 at 02:16:29PM -0500, Dick Brooks wrote:
> Here is a section of embedded SQL code that works fine in Oracle (some code
> removed for brevity):
>
> void open_database(char *user_name, char*pass_word)
> {
> EXEC SQL CONNECT :user_name IDENTIFIED BY :pass_word;
> }
This only work with Pro*C if you run it in full parse mode. That means Pro*C
will parse your complete C file an not just the EXEC SQL parts. I would not
recommend doing this. At first glance it looks like a nice feature but you
can run into numerous sorts of trouble.
> The only way I could get ecpg to process this code was to include a DECLARE
> section, for example:
Yes, that's the standard way of doing this.
> Does anyone know of a workaround to allow use of the function parameters
> with having to declare them first?
No, there is none. The full parse mode has been on my todo list for a long
time but with very low priority. Sorry.
Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!