ECPG: Structure definitions in header files

Поиск
Список
Период
Сортировка
От Poul Jensen
Тема ECPG: Structure definitions in header files
Дата
Msg-id 000001c50afe$1ae7b190$b81ee589@flyvholm
обсуждение исходный текст
Список pgsql-novice

I’m aiming to build a database containing meta-data for a lot of raw data files. A system of C programs are used to read the raw data files, and the specific parameters I want to put in my database are stored in a few structures. The structures are defined in header files. Here are a couple of problems I encounter:

 

1) I first include the relevant header files with an EXEC SQL INCLUDE statement and then declare them in an EXEC SQL DECLARE section, but when meeting the structures in the DECLARE section, ECPG returns an ‘invalid datatype’ error:

 I can copy the structure definition from the header file and paste it into the DECLARE section to avoid this, but that’s not a very elegant solution, and I thought the EXEC SQL INCLUDE command existed to avoid this. Does the structure definition really have to be in the DECLARE section explicitly, and if so, what is the EXEC SQL INCLUDE command supposed to be good for? ( Note: I am a novice to C as well! :-| )

 

2) Unfortunately, one of the structures contains a multidimensional array:

  int16 lag[LAG_SIZE][2];

This causes the following error message from ECPG: “No multidimensional array support for simple data types”. Does that mean I cannot use anything in this structure without redefining it (split the multidimensional array) or copy everything to different variables? I don’t want to redefine it since it is used by a number of other programs.

 

Thanks a lot in advance!!!

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

Предыдущее
От: "Kevin Crenshaw"
Дата:
Сообщение: Text type versus Varchar(n)
Следующее
От: "T. Steneker"
Дата:
Сообщение: Problem with alias/case in query