IBM i GYMN – FIRST SECTION: “Physical data layer and System i Navigator – Views/Indexes”

Following the IBM i GYMN activities ( see the main post: https://linkedibmi.com/2018/01/18/ibm-gymn-come-train/  ), I started with details about the  database created by DDL and SQL instructions and by the use of “System i Navigator” ( if you need to install it follow this post: https://linkedibmi.com/2018/01/19/ibm-gymn-system-navigator-installation/ ).

In the previous posts:

I discussed about table creation modality:

https://linkedibmi.com/2018/01/21/ibm-gymn-first-section-physical-data-layer-system-navigator/

and keys, constraints, queries:

https://linkedibmi.com/2018/01/23/ibm-gymn-first-section-physical-data-layer-system-navigator-constraints-keys-query/

In this post I will discuss about the way to add views and indexes on our tables.

As the usual we could operate on the main menu of the created table (I am sorry to show menu in italian language, I am looking for an english version of “System i Navigator”). If you want to CREATE AN INDEX, you could launch the index creation by the label ‘Indice’ in the image:

 

The following window will be opened. You could specify both the name of the index and the related table:

Then if you go on the next tabbed (“Chiave”) you could add all the columns you want to your index:

and, after you add the column, you could define a related expression for your needs:

 

You could define WHERE clauses too and see the results:

At the end you could visualize all the indexes created by the label:

Or visualize all the objects in your schema: tables, indexes, constraints.. etc:

So you could come back to your index and modify it:

With the option “Genera l’SQL” you could generate SQL instructions to create your index:

The following windows will be opened:

And the script is showed:

 

If you want to CREATE A VIEW you should follow this menu:

As the usual you should define the name and description:

And an SQL instruction for your view that could be created by your self or with the SQL Assistant:

You have the possibility to see your code, check it and the results by the SQL Assistant:

Leave a Reply

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