Coding in RPG (IBM i/AS400). Converting Logical Files to SQL Indexes or Views

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • In this example video, I'd like to show you how a logical file, can be converted to a SQL index or view, depending on the case.
    In some cases, while converting logical files into indexes, we will have no need to write any code, and the programs that uses that logical file will work in the same way without doing anything else. In other cases, we will have to make changes in our programs.
    Let's modernize our databases and programs!
    Please, let me know what you think about it. Leave your comments below.
    Don't forget to subscribe!
    #ibmi #ibm #rpg #rpgle #rpgfree #newvideo #ibmtraining #ibmcoding #rpgtraining #as400 #common #modernize #modernizingDB2 #DB2 #SQL #convertingLogicalFiles #bestperformance #databaseperformance #SQLindexes #SQLviews
    0:00 Introduction
    0:26 The physical and logical files that we will use in the example
    0:45 The original DDS of the logical files
    1:27 The program that we use in the example
    2:17 Running the program (first run)
    3:58 Doing an SQL SELECT on the first logical file
    4:27 Converting the first logical file into an SQL index
    6:48 Doing an SQL SELECT on the converted logical file (the SQL index)
    7:44 Converting the second logical file into an SQL index
    8:53 Converting the third logical file into an SQL view (why not an index?)
    9:36 Running the program (second run)
    10:40 Problems that we can have converting the logical file into a view
    10:53 Running the program (third run)
    11:45 Fixing the problem caused by converting the logical file into a view
    12:10 Running the program (fourth run)
    12:19 Final comments and ending
  • Věda a technologie

Komentáře • 7

  • @bharatsingh6154
    @bharatsingh6154 Před 9 měsíci +1

    Thanks for the vid. Just a quick question. What is more efficient, a LF or Index. and reasons.

    • @ChristianLarsenRPG
      @ChristianLarsenRPG  Před 9 měsíci

      Hi!
      Today, an index is more efficient, because the database is optimized to use SQL.
      But of course, it depends on many factors... for example, the table, the number of fields it has, etc.
      If you work with native RPG, the idea is to update the database first... and then the programs, so that everything works more optimally.
      Thanks for your comment!

  • @miguelowada
    @miguelowada Před 9 měsíci +1

    Dear sir, thank you for sharing your experience in your videos, I wanted to ask a question, can you perform a query on a field and have it show the results while you are writing? It is an interactive RPG program. Thank you very much in advance.

    • @ChristianLarsenRPG
      @ChristianLarsenRPG  Před 9 měsíci

      Hi! Thanks for your comment....
      I do not understand the question....
      The database locks a record while it is updating it... therefore, whenever you read information from a file, this is the last one that is saved in it...
      You have to be careful with commitment control in these cases...

  • @waler9
    @waler9 Před 9 měsíci +1

    Éste pana solo hace videos en inglés 😢

    • @ChristianLarsenRPG
      @ChristianLarsenRPG  Před 9 měsíci +1

      Puedes cambiar los subtítulos y ponerlos en español si lo necesitas... o en cualquier otro idioma.
      Gracias por tu comentario!

    • @waler9
      @waler9 Před 9 měsíci

      @@ChristianLarsenRPG Muchas gracias Man