IBM i GYMN – SECOND SECTION: “Data access layer – Procedures”

After the start of the FIRST SECTION – CASE STUDY (see the link: we could go ahead to the next step of our education pattern:

SECOND SECTION: “Data access layer – Procedures, Triggers,  Functions”

I would thank MAINTEC ( see the link for supporting us with their server and for the their assistance.


I remember you that you could execute the scripts of the exercise if you don’t have enough time by the following steps. First press on this link when you are on the database:

then you could import them or execute in the text area the scripts:


In this section we will start to elaborate PROCEDURES, in detail SQL procedures, so made by SQL directly and not external procedures inside a program. Follow this link to create a new one:


This new window will be opened, where you could define the name, the schema and the kind of program (main or service program):


In the parameters tabbed you could add input parameters by pressing the apposite button (“Aggiungi” in the picture). By the other buttons you could change the order, modify or cancel a parameter:


You could specify options in this apposite tabbed, about the access to data, the debugger mode, the commit, for example:

And you could define all the OPTIONS by checking “Specifica istruzione SET OPTION” and by clicking “Modifica”:


At the end you could define the body of the routine. A list of examples will be available by pressing examples button:


At the end you should see your procedure in the procedure list:


or inside all the object previously created:


As the usual you could generate SQL script and store it on your PC:




Leave a Reply

Your email address will not be published. Required fields are marked *