ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Integers in display files?

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

  • Integers in display files?

    I have an SQL table that has an ID field defined as an integer. I would like to have a hidden field on my subfile to hold that value so I can use it in my RPGLE program later. So far, I haven't figured out how to define it on the DDS in such a way that it can handle the integer.

    I've tried a few different ways of defining and converting, but...I obviously don't know what I'm doing

    Is it possible to have an integer on a display file?

    More detail:
    I have a header and detail table. The identity field on the header table is a foreign key on my detail table so I can keep things in synch.
    On screen 1, I populate the header data which has a range of inventory locations to count. The user chooses one of that list and goes to screen 2. Screen 2 shows them all of the parts in the first location in the range. When they finish that location, they are supposed to see the second location, etc. I was hoping to use that ID to help keep track, but it isn't necessarily required.

    Thank you in advance!

  • #2
    Unfortunately, a data type of integer is not allowed in DDS. You can define a numeric field (data type S or Y, or if you leave data type blank, it will default to numeric if a value is entered for Decimal Positions) in the subfile and convert the integer to the numeric field before you write the subfile record (Eval number = integer), and convert it back after the subfile record is read. Just make sure to define the numeric field big enough to hold the value of the integer (maximum length for numeric is 31 on a display file).

    Comment

    Working...
    X