The scope ofcursor-nameis the source program in which it is defined; that is, the application program submitted to the precompiler. Thus, you can only refer to a cursor by statements that are precompiled with the cursor declaration. For example, a COBOL program called from another program ca...
Suppose that your program examines data about people in department D11 and keeps the data in the EMP table. The following examples show the SQL statements that you must include in a COBOL program to define and use a cursor. In these examples, the program uses the cursor to process a set ...
This also simplifies the codegen as you do not have to look out for DECLARATIVES at all (at least not for gixsql) and you'd comply with the COBOL standard rule "if any paragraph is in a section, every paragraph must" by implicit inserting them into the last section if there is one....
Since all the declarations must be made in declaration section. If you know your SELECT statement you can use I use regular cursor. If your SELECT is dynamic e.g. it changes with some variable value (v_manage=1 then this else that) then its a problem because you can check the variable...