From: Enrique Rodriguez Lazaro <enrique@xpress.es>
To: pgsql-interfaces@postgresql.org
Subject: Problems whit insert from psql
Date: Mon, 29 Nov 1999 13:45:07 +0100
Message-ID: <38427553.E8A9482@xpress.es> (raw)
Hi.
How can I do a 'insert' from psql?
I can do a select but I can't do a insert.
The select:
sprintf(temp_string,"DECLARE atotal CURSOR FOR select * from clientes");
res1 = PQexec(conn,temp_string);
if (PQresultStatus(res1) != PGRES_COMMAND_OK) {
fprintf(stderr,"DECLARE CURSOR command failed0");
PQclear(res1);
exit_nicely(conn);
}
All it's ok.
The insert:
sprintf(temp_string,"DECLARE atotal CURSOR FOR insert into clientes
values('3','prueba','123')");
res1 = PQexec(conn,temp_string);
if (PQresultStatus(res1) != PGRES_COMMAND_OK) {
fprintf(stderr,"DECLARE CURSOR command failed0");
PQclear(res1);
exit_nicely(conn);
}
The problem aren't in data base. At psql's prompt i can do:
psql==>insert into clientes values('3','prueba','123');
Ok, no problems.
Thanks in advanced.
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: enrique@xpress.es
Subject: Re: Problems whit insert from psql
In-Reply-To: <38427553.E8A9482@xpress.es>
* 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