Re: ecpg - Mailing list pgsql-novice

From Jochen Weyermanns
Subject Re: ecpg
Date
Msg-id C1256957.00246E84.00@kisters-ac1.kisters.de
Whole thread Raw
In response to ecpg  ("Chris McNett" <chrismcnett@hotmail.com>)
List 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



pgsql-novice by date:

Previous
From: "Chris McNett"
Date:
Subject: ecpg
Next
From: DWalker@black-oak.com
Date:
Subject: Re: Multiple Selects