pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: Phil Moors <pmoors@phillips.com>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [INTERFACES] No such connection NULL from ECPG
Date: Fri, 25 Jun 1999 09:45:01 +0200
Message-ID: <19990625094501.A1535@gmx.net> (raw)
In-Reply-To: <3772AEFB.78E1469F@phillips.com>
References: <3772AEFB.78E1469F@phillips.com>

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!



view thread (3+ messages)  latest in thread

Message-ID: <19990625094501.A1535@gmx.net>
Permalink:  ../19990625094501.A1535@gmx.net/
Also on:    postgresql.org/message-id/19990625094501.A1535@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: meskes@postgresql.org, pmoors@phillips.com
  Subject: Re: [INTERFACES] No such connection NULL from ECPG
  In-Reply-To: <19990625094501.A1535@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox