Progress
Language Reference


ROWID Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns the unique internal identifier of the database record currently associated with the record buffer you name. This internal identifier has the data type ROWID, which is supported for Progress and all other DataServer databases.

NOTE: This function replaces the RECID function for most applications. However, you must use the RECID function for maintaining schema objects (file and field relationships) in the Progress metaschema files. For more information, see the Progress Programming Handbook .

SYNTAX

ROWID ( record ) 

record

The name of the record whose ROWID you want.

To use the ROWID 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.

EXAMPLE

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 ROWID function puts the internal database identifier of that record in the crowid variable. If the user decides to update the credit-limit field, the procedure finds the record again using the value in crowid. 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.

r-rowid.p
DEFINE VARIABLE response AS LOGICAL.
DEFINE VARIABLE crowid AS ROWID.

REPEAT:
    PROMPT-FOR customer.cust-num.
    FIND customer USING cust-num NO-LOCK.
    crowid = ROWID(customer).
    DISPLAY name .
    response = YES.
    UPDATE response LABEL "Update credit-limit ?".
    IF response THEN DO:
        FIND customer WHERE ROWID(customer) = crowid EXCLUSIVE-LOCK.
        UPDATE credit-limit.
    END.
END. 

NOTES

SEE ALSO

DEFINE BUFFER Statement, DEFINE VARIABLE Statement, RECID Function, Record Phrase, REPOSITION Statement, STRING Function, TO-ROWID Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095