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