This function is supported for backward compatibility. For most applications, use the ROWID function, instead. For more information, see the ROWID function reference entry.
RECID ( record )To use the RECID function with a record in a table defined for multiple databases, you must qualify the record’s table name with the database name. See the Record phrase reference entry for more information.You might decide that you do not want to lock a record until the user starts to update that record. In the example procedure, the FIND statement reads a Customer record without locking the record. The RECID function puts the internal database identifier of that record in the crecid variable. If the user decides to update the CreditLimit field, the procedure finds the record again using the value in crecid. The second FIND statement reads the record again, this time placing an EXCLUSIVE-LOCK on it. Because the record is first found with NO-LOCK, it is possible for the record to be updated by another user after the first FIND and before the second.
DEFINE VARIABLE response AS LOGICAL NO-UNDO.DEFINE VARIABLE crecid AS RECID NO-UNDO.REPEAT:PROMPT-FOR Customer.CustNum.FIND Customer NO-LOCK USING Customer.CustNum.crecid = RECID(Customer).DISPLAY Customer.name.response = YES.UPDATE response LABEL "Update credit-limit ?".IF response THEN DO:FIND Customer WHERE RECID(Customer) = crecid EXCLUSIVE-LOCK.UPDATE Customer.CreditLimit.END.END.
DISPLAY (IF AVAILABLE Customer THEN RECID(Customer) ELSE ?).
FOR EACH Customer NO-LOCK:DISPLAY Customer.CustNum.END.DISPLAY RECID(Customer).
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |