Was this helpful?
The Inquire_ingres Statement
An example of the use of the inquire_ingres statement follows:
begin program
## rcount, err_no   integer
## errmsg          character_string(256)
## ingres   "personnel"
## append to employee (empnum = 12, 
##  empname = "john smith", salary = 10000)
## /* find out if an error occurred while appending */
## inquire_ingres (rcount = rowcount, err_no = errorno,
## errmsg = errortext)
## /* if error occurred, print its number and message */
  if err_no > 0 then      print "ingres error", errorno, "occurred"
    print errmsg
## /* tell the user whether or not a row was added */
 else if rcount > 0 then
    print "row successfully appended"
 else
    print "integrity violation or duplicate record"
 end if
## exit
end program
The rowcount value is useful for detecting integrity violations.
Last modified date: 11/28/2023