Theo Kouwenhoven
asked on
SQLRPGLE with spoolfile
Hi Experts,
If I run a SQL command from CL with e.g.:
RUNSQL SQL('Delete FROM myTable WHERE myField < 100') OPTION(*LIST)
I get the numers of deleted rows in a spoolfile,
Now I like to have the same with SQLRPGLE, is that possible?
If I run a SQL command from CL with e.g.:
RUNSQL SQL('Delete FROM myTable WHERE myField < 100') OPTION(*LIST)
I get the numers of deleted rows in a spoolfile,
Now I like to have the same with SQLRPGLE, is that possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yeah, Theo - GET DIAGNOSTICS is pretty useful. Note that it can be resource-intensive, and some options come with a higher cost than others. Best to only use it when you have to.
You can also get the row count "for free" in RPG by checking the contents of SQLER3 (a field in the SQLCA data structure that is automatically declared in RPG programs using embedded SQL by the SQL precompiler). See page 6-7.
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzajp/rzajppdf.pdf
You can also get the row count "for free" in RPG by checking the contents of SQLER3 (a field in the SQLCA data structure that is automatically declared in RPG programs using embedded SQL by the SQL precompiler). See page 6-7.
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzajp/rzajppdf.pdf
ASKER
Thanks, learned a lot today :-)
Nice options also for error handling
Cheers