insert into table from C/C++ application

Поиск
Список
Период
Сортировка
От Brian Kurt Fujikawa
Тема insert into table from C/C++ application
Дата
Msg-id 3A9E8574.B3C42BD@lbl.gov
обсуждение исходный текст
Список pgsql-general
Hello

I would like to insert values into a table from a C or C++ application.
The only way that I know how to do this is some variation of:

...

PgDatabase my_db("dbname=my_database");

...

char text[256];

sprintf(text,"INSERT INTO my_table VALUES (1,2,3,4,5);");

int err=my_db.ExecCommandOk(text);

...

This seems sort of clumsy to me - especially if the table has many
columns. Is there a better way of doing this?

Thank you very much.

Brian
--
Brian Kurt Fujikawa
Weak Interactions Group
Institute for Nuclear and Particle Astrophysics
Lawrence Berkeley National Laboratory
1 Cyclotron Road, MS 50-208
Berkeley, CA 94720, USA
http://bkf0.lbl.gov/fujikawa/
mailto:bkfujikawa@lbl.gov
tel: +1-510-486-4398
fax: +1-510-486-6738

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

Предыдущее
От: "Gregory Wood"
Дата:
Сообщение: Re: JOIN of a table with many detail tables
Следующее
От: Geoff Russell
Дата:
Сообщение: Set Operators and Arrays Question