I'm trying to print the rows of a table in embedded sql. I have this code where publication is the table and pubid is the attribute. I tried this:
EXEC SQL DECLARE C1 CURSOR FOR SELECT pubid FROM publication;
EXEC SQL OPEN C1;
EXEC SQL WHENEVER NOT FOUND GOTO close_c1;
for(;;) {
EXEC SQL FETCH C1 INTO :pubid;
cout<<pubid<<endl;
}
close_c1:
EXEC SQL CLOSE C1;
The compiler gives me this error: error: label 'close_c1' used but not defined. How do I fix this?