Iseries Sql Manual

Iseries Sql Manual Average ratng: 10,0/10 550 reviews
Active2 years, 8 months ago

(Let me preface this by saying I am extremely new to the AS400 and RPGLE and CL Programming. I know SQL fairly well, but not when in use with the AS400)

This seems like it should be very simple.

SQL in iSeries Navigator I n V4R4, IBM added an SQL scripting tool to the standard features included within iSeries Navigator and has continued enhancing it in subsequent releases. Because standard features of iSeries Navigator are avail-able to customers at no charge, this new feature marks a new era in SQL development on the iSeries. Magnetic, optical, chemical, manual, or otherwise, without prior written permission of Tivoli Systems. The document is not intended for production and is furnished “as is” without warranty of any kind.All warranties on this document are hereby disclaimed including the warranties of merchantability and fitness for a particular purpose. Information about Query for iSeries queries” on page 15. In most cases, the result fields that you define appear in your query output, but selecting them for output is optional since some result fields are only needed as an intermediate step to obtain a final result.

  1. Iseries Sql Manual V6r1 We run JD Edwards World 9.2 on an IBM iSeries/AS400 V6R1 machine. I was thinking I could write a quick php file that would run an sql query to parse the results to a csv in IFS and vice.
  2. SQL for eServer i5 and iSeries - Chapter 2 This chapter, 'SQL in iSeries Navigator,' from SQL for eServer i5 and iSeries by Kevin Forsythe (MC Press.) explains how to use the SQL scripting tool included in iSeries Navigator, such as how to configure the SQL script environment and run multiple SQL scripts.
  3. SQL programming. 1 What's new for IBM i 7.2. 1 PDF file for SQL pr ogramming. 4 Intr oduction to Db2 for i Str uctur ed Query Language 4. Managing SQL and external r outine objects. 240 Impr oving performance of pr ocedur es and functions.

At Year End we have to update our warehouse table to the new current year. This has been a manual process, to go to STRSQL and run

This has been done by the same person for the past 40 years and they are now retiring this year. My boss wants this to become a CL Program where it is all done without someone manually running the STRSQL command and it can be integrated into the Year End Process.

All the CL Program has to do is prompt for what year you want to change the warehouse files too and upon entering the date into the screen it would run the SQL program and update the records according to the SQL command.

Can someone please point me into a direction where I might be able to learn more about using the CL program to accomplish this process?

Thank you.

Iseries Sql Manual

Thomas J Cusick, Systems Programmer

TomCusickTomCusick

3 Answers

Assuming you're on a currently supported version of IBM i.

IBM added a RUNSQL CL command a few versions ago..

Free your uninstaller key free. Aug 17, 2019  Your uninstaller full key is one of the most powerful and fast uninstaller software. Your unistaller helps you remove root software, including the most stubborn software.

A complete CL program would thus look like so:

But it'd be better if you passed in the year as a parameter..

CharlesCharles
12.6k1 gold badge11 silver badges32 bronze badges

A very simple example using RPGLE and DDS instead of CL or QMQRY would look like this:

Iseries Sql Reference

The display file:

RPGLE

Sql Iseries Examples

This defaults the current year into the prompt, and provides a message when the entered year deviates too far from the current year. Not as quick and dirty as the QMQRY solution, but really not all that complex either, and once you have it, you can copy and change the prompt, validation, and SQL to your hearts content.

jmarkmurphyjmarkmurphy

Iseries Sql Manual Free

Thanks Charles, this helped..In the mean while my boss came to me with an example of what he actually was looking for and the following is what I ended up doing.

First I created a File CLD@91Q1 of Type *QMQRY, this file holds the actual SQL statement..

UPDATE &GWHRE.RCO SET CCFSCY = &SELYEAR WHERE CRSTS = 'A'

Second I created a XCLP that calls the CLD@91Q1 Query

and Finally I created the XDSPF file to give the user a place to enter the needed information.

Looking at this it appears to be kinda convoluted but this is what the Boss wanted so this is what the boss got.

Ibm Iseries Manuals

I think it's a good exercise and I can see using this kind of process in more complex SQL statements. Ati rv370 drivers win 10.

TomCusickTomCusick

Not the answer you're looking for? Browse other questions tagged sqlibm-midrangerpgle or ask your own question.