5. Embedded QUEL for Ada : Precompiling, Compiling and Linking an EQUEL Program : Coding Requirements for Writing EQUEL Programs : An EQUEL Statement that Does Not Generate Code
 
Share this page                  
An EQUEL Statement that Does Not Generate Code
The declare cursor statement does not generate any Ada code. This statement should not be coded as the only statement in Ada constructs that does not allow null statements. For example, coding a declare cursor statement as the only statement in an Ada if statement not bounded by left and right braces would cause compiler errors:
if (using_database)
##   declare cursor empcsr for retrieve (employee.ename)
else
     put-line("You have not accessed the database");
end if;
The code generated by the preprocessor would be:
if (using_database)
else
     put_line("You have not accessed the database");
end if;
which is an illegal use of the Ada if-then-else statement.