Re: [INTERFACES] No such connection NULL from ECPG - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] No such connection NULL from ECPG
Date
Msg-id 19990625094501.A1535@gmx.net
Whole thread Raw
In response to No such connection NULL from ECPG  (Phil Moors <pmoors@phillips.com>)
List pgsql-interfaces
On Thu, Jun 24, 1999 at 06:19:39PM -0400, Phil Moors wrote:
> My program compiles without errors. When the binary is run, I get:
> 
>     No such connection NULL from line 384.
> 
> ... 
> My connect line is 374:
> 
>         EXEC SQL CONNECT 'macs';

The correct form is EXEC SQL CONNECT TO 'macs'; SQL92 wants to see the TO.

> Ecpg expands this to:
> 
>         { ECPGconnect(__LINE__, NULL,"macs",NULL,NULL, 0);}

Argh! This is one of the dreaded Oracle compatibility hacks. Oracle's
connect syntax is:

EXEC SQL CONNECT <username>

So ECPG thinks macs is the username. But there is another problem. It
shouldn't try to access connection NULL. The code says:

if (dbname == NULL && connection_name == NULL)               connection_name = "DEFAULT";

So why doesn't it display connection DEFAULT. I'll check that.

>         { ECPGconnect(__LINE__, "macs",NULL,NULL,NULL, 0);}

It's line-number, db-name, user, password, connection_name, autocommit mode.

> Am I barking up the wrong tree?

No, there is a problem.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!


pgsql-interfaces by date:

Previous
From: Michael Meskes
Date:
Subject: Re: [INTERFACES] No such connection NULL from ECPG
Next
From: Bruce Momjian
Date:
Subject: Re: [DOCS] Doc for pg_*