Was this helpful?
Using _record and _state
The following example shows the use of the _record and _state constants in an unloadtable loop:
## unloadtable empform employee 
##   (vname = ename, vage = age, vsal = sal, 
##    vnum = eno, state = _state)
## {
     /* based on the value of "state," the program can
     ** replace, delete or append values in the table
     ** "employee," using "vnum" as the unique identifier
     ** in the search condition. in this example, the
     ** program only performs a replace. 
     */
     if (state = 3) then /* state is changed */
##       replace employee
##          (empname = vname, age = vage, salary = vsal)
##           where employee.eno = vnum
     end if
## }
Last modified date: 08/14/2024