Link to home
Start Free TrialLog in
Avatar of Theo Kouwenhoven
Theo KouwenhovenFlag for Netherlands

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?
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Theo Kouwenhoven

ASKER

Hey Gary,

Thanks, learned a lot today :-)
Nice options also for error handling

Cheers
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