We help IT Professionals succeed at work.
Get Started

AS400 Stored Procedures

Geoff Sutton
Geoff Sutton asked
Last Modified: 2013-12-06
I am working with a Windows based server and an AS-400 datasource.  I am wanting to create a databse stored procedure on the 400 with which I can A) Pass in a series of approx 25k account #'s, B) Get necessary data for each of those acct#'s, then return that data using a "Select * from #tmpAcctData" temporary table.  I am able to pass the data in as either delimited string or an array, but I am not familiar enough with the as400 SQL to be able to accomplish the rest.  My specific questions are: Does the 400 support temporary tables, how can I parse a delimited string, how would I iterate through each item in a series?

If you can give me a rough outline of the code I would use for this, I can fill in the details.  
Watch Question
Expert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI
This problem has been solved!
Unlock 1 Answer and 62 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE