Problems whit insert from psql

Поиск
Список
Период
Сортировка
От Enrique Rodriguez Lazaro
Тема Problems whit insert from psql
Дата
Msg-id 38427553.E8A9482@xpress.es
обсуждение исходный текст
Список pgsql-interfaces
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.


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Roberto Joao Lopes Garcia
Дата:
Сообщение: Re: [INTERFACES] libpq + multiple connections ...
Следующее
От: "Oscar Serrano"
Дата:
Сообщение: RE: [INTERFACES] Spanish format on date and numbers