| От | Feite Brekeveld |
|---|---|
| Тема | embedded sql pointer to structure question |
| Дата | |
| Msg-id | 3AB1FFCE.2E29FA84@osiris-it.nl обсуждение исходный текст |
| Ответы |
Re: embedded sql pointer to structure question
|
| Список | pgsql-general |
Hi,
I have an application using structures say
typedef struct {
int id;
char value[40];
} MYREC;
When passing a record to a function insert_record( MYREC *pmyrec)
how to deal with the sql-statement regarding the fields of the struct ?
When doing this (TESTPROGRAM) :
exec sql whenever sqlerror sqlprint;
exec sql include sqlca;
exec sql type MYREC is struct {
int id;
char value;
} ;
int main()
{
MYREC mr;
mr.id = 10;
strcpy(mr.value, "testval");
...
Exec sql begin declare section;
MYREC *pmr = &mr;
exec sql end declare section;
EXEC SQL INSERT INTO test VALUES(:pmr->id, :pmr->value);
...
}
I get the message : ERROR: The variable id is not declared
--
Feite Brekeveld
feite.brekeveld@osiris-it.nl
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера