help on structures
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am working on Informix-SQL 4.0 and having problem in esql with structures. I defined a structure of sessionNode in a header file "structures.h" as typedef struct dummy_name { long surgeryID; /* Surgical_Session:Surgery_ID */ int caseSeq, /* Surgical_Session:Case_Sequence */ ORnumber, /* Surgical_Session:OR_number */ startTime, /* in minutes */ /* Surgical_Session:SurgeryTime */ estDuration; /* in minutes */ /* Surgical_Session:EstDuration */ char procedure[LEN_PROC_DESC+1], /* Surgical_Procedures:ProcedureDesc */ patientID[LEN_PATIENT_ID+1], /* Surgical_Session:Patient_ID */ surgeon1[LEN_SURGEON+1], /* Surgeon_Data:SurgeonLastName */ surgeon2[LEN_SURGEON+1], /* Surgeon_Data:SurgeonLastName */ hardStart; /* *** none *** */ unsigned int errorStatus; int endTime; struct dummy_name *next, /* the next node in the list */ *previous; /* the previous node in the list */ } sessionNode; typedef sessionNode* sessionList; In function of initializeList: #include <stdio.h> #include "structures.h" $include sqlca; int initializeList(List) $sessionList *List; /*return a pointer to the linked list through List The function returns 1 if successful and 0 otherwise */ { $sessionNode *temp; /*temporary*/ I declare a pointer of type sessionNode and sessionList. But the compiler says"Invalid symbol before sessionNode and sessionList. Is it that host variable can only have basic types like $char, $int, $char*. Can we do this to structures? I intend to have List and temp as host variables . If i remove $ sign before sessionNode and sessionList, it gives me error: object "temp" is not declared. Need help on this thanks. /*esqlc: "initialize.ec", line 32: Error -33040: Object 'temp' was not declared. */