I'm a new subscriber of this mailing list and new user of postgresql, let me
first greet everybody reading this mail.
I have a couple of questions about libpq and ecpg.
Is it possible to accomplish a query on a table whose name is specified in a
variable? That is, something like the following:
result=PQexec(conn, "insert into str values('Rome', 10)");
I guess a code like the above one would not give the expected result..... Is
there a way to work that out?
I'm trying to use the ecpg preprocessor to pass arguments of a query in
variables, but I get a few errors.... Here's the piece of code that doesn't
exec sql begin declare section;
exec sql end declare section;
exec sql connect 'prova';
exec sql select * from :str;
exec sql commit;
exec sql insert into :str values('Samp', 10);
exec sql commit;
exec sql disconnect 'prova';
ecpg gives an error message saying: parse error in line 10, that is line "exec
sql insert into :str values('Samp', 10);". If I replace var str with the name
of the table, it works correctly instead. The syntax seems to be correct so I
have no idea about where the error is.
The last question for now is the following: how can I display the content of a
table using ecpg instructions? The statement "exec sql select * from :str;",
doesn't print anything on screen..... Any trick please? Probably this is a
stupid question, so forgive me, I'm new to postgresql! :-)
Thanks to everybody.
Antonello De Santis
pgsql-interfaces by date
|Next:||From: Wojciech Kromer||Date: 1999-03-27 17:45:19|
|Subject: PsqlODBC and 'lo' type in PostrgreSQL 6.4.x|
|Previous:||From: Byron Nikolaidis||Date: 1999-03-27 06:14:47|
|Subject: Re: [Fwd: [INTERFACES] type error inserting large obj, Win32 ODBC]|