/* Processed by ecpg (regression mode) */ /* These include files are added by the preprocessor */ #include <ecpglib.h> #include <ecpgerrno.h> #include <sqlca.h> /* End of automatic include section */ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
if (sqlca.sqlcode < 0) exit (1);} #line49"variable.pgc"
strcpy(msg, "create");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer )", ECPGt_EOIT, ECPGt_EORT); #line52"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line52"variable.pgc"
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 )", ECPGt_EOIT, ECPGt_EORT); #line55"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line55"variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 )", ECPGt_EOIT, ECPGt_EORT); #line56"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line56"variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 1' , 16 )", ECPGt_EOIT, ECPGt_EORT); #line57"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line57"variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 2' , 14 )", ECPGt_EOIT, ECPGt_EORT); #line58"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line58"variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 3' , 9 )", ECPGt_EOIT, ECPGt_EORT); #line59"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line59"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line62"variable.pgc"
strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT); #line65"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line65"variable.pgc"
/* exec sql whenever not found break ; */ #line67"variable.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; #line74"variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} #line74"variable.pgc"
printf("%8.8s", personal.name.arr); if (i->ind_birth.born >= 0)
printf(", born %ld", personal.birth.born); if (i->ind_birth.age >= 0)
printf(", age = %d", personal.birth.age); if (ind_married >= 0)
printf(", married %s", married); if (ind_children.smallint >= 0)
printf(", children = %d", children.integer);
putchar('\n');
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.