Received: from mout1.01019freenet.de (mout1.01019freenet.de [62.104.201.3]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA74144 for ; Fri, 25 Jun 1999 06:40:48 -0400 (EDT) (envelope-from Michael.Meskes@gmx.net) Received: from [62.104.201.2] (helo=mx1.01019freenet.de) by mout1.01019freenet.de with esmtp (Exim 3.02 #5) id 10xTPb-0000Rk-00; Fri, 25 Jun 1999 12:40:47 +0200 Received: from [212.81.152.75] (helo=tanja.fam-meskes.de) by mx1.01019freenet.de with esmtp (Exim 3.02 #5) id 10xTPD-0006o1-01; Fri, 25 Jun 1999 12:40:23 +0200 Received: (from meskes@localhost) by tanja.fam-meskes.de (8.9.3/8.9.3/Debian/GNU) id JAA02051; Fri, 25 Jun 1999 09:45:01 +0200 Date: Fri, 25 Jun 1999 09:45:01 +0200 From: Michael Meskes To: Phil Moors Cc: PostgreSQL Interfaces Subject: Re: [INTERFACES] No such connection NULL from ECPG Message-ID: <19990625094501.A1535@gmx.net> Mail-Followup-To: Phil Moors , PostgreSQL Interfaces References: <3772AEFB.78E1469F@phillips.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <3772AEFB.78E1469F@phillips.com>; from Phil Moors on Thu, Jun 24, 1999 at 06:19:39PM -0400 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 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!