Re: ecpg

From: "Jochen Weyermanns" <jowe(at)kisters(dot)de>
To: "Chris McNett" <chrismcnett(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ecpg
Date: 2000-09-11 06:37:54
Message-ID: C1256957.00246E84.00@kisters-ac1.kisters.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Chris !

> I am using ecpg and get error -402 (cannot connect to database). The
> database works fine with the psql command. It probably won't help, but here
> is my code:

> EXEC SQL BEGIN DECLARE SECTION;
> /* list of declarations */
> EXEC SQL END DECLARE SECTION;
> ...
> EXEC SQL CONNECT databasename; /* error happens here */

I think You have to prefix an ':' to variables for usage within embedded SQL
statements
Try this:
EXEC SQL connect to :databasename user :username;

Jochen

Browse pgsql-novice by date

  From Date Subject
Next Message DWalker 2000-09-11 12:56:38 Re: Multiple Selects
Previous Message Chris McNett 2000-09-09 23:39:58 ecpg