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?
SQL* IBMi* iSeriesSQL

Avatar of undefined
Last Comment
Gary Patterson, CISSP
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
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
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo