Menu

#55 EXEC SQL INCLUDE

v1.0 (example)
open
nobody
INCLUDE (1)
5
2015-04-22
2015-04-21
Inaki GE
No

Hi,
Similar to COPY REPLACING statement it exists another statement to include copybooks containing definitions for tables that it is EXEC SQL INCLUDE copybook END-EXEC . The only difference between them is that COPY statements are executed at compile time while INCLUDE is executed at run time.

It would be good if you could add to Koopa the EXEC SQL INCLUDE copybook END-EXEC implementation in order to add the definitions of the copybook. The effort would be very low as the implementation is the same that for COPY statement.

Thanks for your support.
Regards.

Discussion

  • KrisDS

    KrisDS - 2015-04-21

    Do you mean you want Koopa to replace the EXEC SQL INCLUDE with the contents of the copybook ? Similar to the preprocessing logic ?

     
  • Inaki GE

    Inaki GE - 2015-04-21

    Hi,
    Yes, that would be perfect and I think it would add another functionality to Koopa. And, as I told you, I suppose the effort would be low as it is the same as COPY statement.

    Thanks.

     
  • KrisDS

    KrisDS - 2015-04-21

    You're free to take the easy ones and implement them. ;-)

    But it's not as straightforward as that. The SQL support is not part of the preprocesser stage, and that will need some refactoring.

    May I ask what the advantage of expanding these statements would be ? I'm assuming the SQL copybooks are better defined and behaved, and so you should be able to parse them individually. With regular copybooks this is not necessarily so, and adding support for them made more sense. I don't know whether that's the case with SQL INCLUDE...

     
  • Inaki GE

    Inaki GE - 2015-04-21

    Hi again,

    the reason to deploy the copybooks of EXEC SQL INCLUDE statements is the same of COPY REPLACING statements: gather the variable definition and initialization and other possible statements that could take part in the program.

    I know that you do not process EXEC SQL statements but I would say this must be and exception and EXEC SQL INCLUDE statements should be parsed and deployed by Koopa because the goal is the same of COPY REPLACING statements. The grammar it is by far easier than other SQL statements:

    EXEC SQL
    INCLUDE copybookName
    END-EXEC

    Thanks for your support.
    Regards.

     
  • KrisDS

    KrisDS - 2015-04-21

    Could you not get the same info by parsing the SQL copybook separately ? I understand you want the information they contain. What I don't understand is why you can't get it from the SQL copybook directly.

    And I know the grammar is simple. It's already supported as described. But the expansion of an SQL include is not done.

     
  • Inaki GE

    Inaki GE - 2015-04-22

    Hi,

    the benefit of deploying the copybook is to gather all the definitions in the same program and not separately. In my case I have more than 28.000 copybook files and almost 6.000 cbl files so this becomes a problem when parsing.

    Anyway, as Koopa is not supporting SQL include statements and, as you state, a refactoring is needed I will be obligued to find another solution. I think that replace SQL include by COPY could be a quick and good way to do it.

    Thanks.
    Regards.

     
  • KrisDS

    KrisDS - 2015-04-22

    If you need this soon, then that would be an alternative, yes.

     

Log in to post a comment.