ABSTRACT and SQLRGPLE
Posted: Mon Sep 27, 2021 9:08 pm
We use the ABSTRACT command Work with File Usage (WRKFILU) quite often. We've noticed that any file that's used within an embedded SQL statement will not be retrieved unless the file is declared in the F-spec.
Obviously, defining these files in the f-spec in every SQLRPGLE program would solve the problem but it also makes things cumbersome for the developer moving forward. If the file needs to be declared with *update or *output usage we like to include the usropn keyword to the definition and perform a quick open/close in the program as well. This way the file isn't open with update access the entirety the program's uptime. Is this going to far?
Is there any other way to get file usage statistics from embedded SQL statements without going through all this?
Thanks!
Obviously, defining these files in the f-spec in every SQLRPGLE program would solve the problem but it also makes things cumbersome for the developer moving forward. If the file needs to be declared with *update or *output usage we like to include the usropn keyword to the definition and perform a quick open/close in the program as well. This way the file isn't open with update access the entirety the program's uptime. Is this going to far?
Is there any other way to get file usage statistics from embedded SQL statements without going through all this?
Thanks!