• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

ovrdbf on data source

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ovrdbf on data source

    Hello,
    On my IBMi I have a green screen program that requires the user to choose a Fiscal Year. After they choose the year, the program issues an OVRDBF to point to the file holding the financial data for that year. In Valence it looks like you have to create a separate data source for each year and re-create the widgits and apps. What is the recommended method to do this with Valence? Are there some postings that explain a way to do this. I'd appreciate some guidance.
    Thanks,
    Bruce Wilson

  • #2
    You can use a vvIn_Virtual in your SQL statement to dynamically change the table and/or library. For example, here is a statement where, via an app variable, I can change the table dynamically by setting the app variable customerTable to something else.

    By default, it’s using VALENCE6.DEMOCMAST; however, I could easily set customerTable to VALENCE52.DEMOCMAST by changing the app variable customerTable.

    Blog on vvIn_Virtual

    Code:
    SELECT
      *
    FROM
      vvin_virtual(
        'customerTable',
        'valence6.democmast',
        'char',
        25,
        NULL,
        'false'
      )
    ORDER BY
      cusno DESC

    Comment


    • #3
      One more option, if you prefer to continue with the OVRDBF approach, would be to add a pre-execution exit program to your data source. You could then have a custom program apply the appropriate OVRDBF command prior to the data load.

      Last edited by robert.swanson; 11-17-2024, 03:02 PM.

      Comment

      Working...
      X