pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryan Mooney <ryan@pcslink.com>
To: pgsql-interfaces@postgresql.org
Subject: ECPG Connect user :variable problem
Date: Tue, 19 Aug 2003 12:17:08 -1000
Message-ID: <20030819221656.GA10232@pcslink.com> (raw)


Hello,

I'm having a major problem using ecpg with 7.4beta1.  The problem is that
if I try to pass in the username or password as :variables to the EXEC SQL
CONNECT code they are essentially ignored (replaced by " ?").

I've tried it on both redhat 7.2 IA64 and Redhat 9.0 IA32 (different enough 
that I don't think its the platform).   I also tried it with postgres 7.3.2
which seemed to do the "right thing" and put the variables into the ECPGconnect
call.

Any thoughts?

------------------------------<snip "connect.pgc">---------------------------------
int pg_connect(void)
{

    EXEC SQL BEGIN DECLARE SECTION;
    char *target = "dbname";
    char *connection_name = "myconnection";
    char *uname = "myuser";
    char *password = "mypassword";
    EXEC SQL END DECLARE SECTION;

    EXEC SQL CONNECT TO :target as :connection_name user :uname using :password;

}

------------------------------<snip "connect.c">---------------------------------

int pg_connect(void)
{

	/* exec sql begin declare section */
	   
	   
	   
	   
	
#line 5 "connect.pgc"
 char * target  = "dbname" ;
 
#line 6 "connect.pgc"
 char * connection_name  = "myconnection" ;
 
#line 7 "connect.pgc"
 char * uname  = "myuser" ;
 
#line 8 "connect.pgc"
 char * password  = "mypassword" ;
/* exec sql end declare section */
#line 9 "connect.pgc"


	{ ECPGconnect(__LINE__, 0, target , " ?" , " ?" , connection_name, 0); }
#line 11 "connect.pgc"


}


-- 
>-=-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-=-<
Ryan Mooney          				 ryan@pcslink.com 
<-=-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-=-> 



view thread (4+ messages)  latest in thread

Message-ID: <20030819221656.GA10232@pcslink.com>
Permalink:  ../20030819221656.GA10232@pcslink.com/
Also on:    postgresql.org/message-id/20030819221656.GA10232@pcslink.com

 · 

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: ryan@pcslink.com
  Subject: Re: ECPG Connect user :variable problem
  In-Reply-To: <20030819221656.GA10232@pcslink.com>

* 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