BrianGarland / blog

This is my blog
1 stars 0 forks source link

Dynamic SQL in RPGLE and cross-reference tools #7

Open BrianGarland opened 3 years ago

BrianGarland commented 3 years ago

Most cross-reference tools do not include tables and views referenced in dynamic SQL statements.

In order to get around that, you can simply add an external data structure as a template.

DCL-DS data_struture EXTNAME('file') QUALIFIED TEMPLATE

This gives you the advantage of now being able to define work fields with LIKE.

JDubbTX commented 3 years ago

So are you suggesting to define the template so it will be recognized by xref tools (like XAnalysis), even if you aren't using the template in your code?

BrianGarland commented 3 years ago

@JDubbTX Yes. You do not need to use the template for this trick to work. Of course, it would be good to define any work fields to be LIKE the database columns.