Received: from maria.xpress.es (bestia.xpress.es [194.224.86.3]) by hub.org (8.9.3/8.9.3) with ESMTP id HAA11801 for ; Mon, 29 Nov 1999 07:42:13 -0500 (EST) (envelope-from enrique@xpress.es) Received: from xpress.es (idefix.xpress.es [194.224.86.59]) by maria.xpress.es (8.8.8/8.8.8) with ESMTP id NAA11136 for ; Mon, 29 Nov 1999 13:25:35 GMT Sender: enrique@bestia.xpress.es Message-ID: <38427553.E8A9482@xpress.es> Date: Mon, 29 Nov 1999 13:45:07 +0100 From: Enrique Rodriguez Lazaro X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.0.36 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Problems whit insert from psql Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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.