esql help needed
Posted in 1992
In a UNIX environment $ typedef'ing hasn't been a problem for me; but, I'm
working on a small project involving DOS INFORMIX (2.1.xx). Below is a
sample of what I'm trying to do - in UNIX it works just fine. In DOS, I
get loads of error messages:
test.h line# Invalid type or storage class 'typedef'
test.h line# Syntax error on keyword or symbol 'struct'
test.ec Invalid type or storage class 'ms'
It seems to be a problem with the '$' before the typedef.
Any ideas as to what the problem is?
/********************* test.h *********************/
$ typedef struct {
char field_1[21];
char field_2[21];
int field_3;
} STRUCT_TEST;
/******************** end of test.h *********************/
/******************** test.ec ********************/
#include <stdio.h>
$include "test.h";
$include sqlca;
void main ( void )
{
$ STRUCT_TEST ms[1];
$ database test_db;
$ declare TEST_CUR cursor for
select *
into $ms
where conditions ...;
$ open TEST_CUR;
$ fetch TEST_CUR;
while(!sqlca.sqlcode){
fprintf(stdout,"%s %s %d\\n",ms->field1,ms->field2,ms->field3);
$ fetch TEST_CUR;
}
$ close TEST_CUR;
}
/******************** end of test.ec ********************
--
=============================================================
Bob Beaulieu bobb@netcom.com
San Jose, CA (408) 978-0818
=============================================================