| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== RELEASE (release a held record) ====== | [[reget re get record .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[remove erase a file .htm|{{btn_next_n.gif|Next page}}]] | | || **RELEASE(**// entity //**)** {{blk2blue.jpg|blk2blue.jpg}} | **RELEASE** | Releases the held record(s). | | //entity// | The label of a FILE or VIEW declaration. | The **RELEASE** statement releases a record previously held by the HOLD procedure. It will not release a record held by another user in a multi-user environment. If the record is not held, or is held by another user, RELEASE is ignored. **Example:** **ViewOrder VIEW(Customer)  !Declare VIEW structure** **           PROJECT(Cus:AcctNumber,Cus:Name)** **           JOIN(Hea:AcctKey,Cus:AcctNumber) !Join Header file** **            PROJECT(Hea:OrderNumber)** **            JOIN(Dtl:OrderKey,Hea:OrderNumber) !Join Detail file** **             PROJECT(Det:Item,Det:Quantity)** **             JOIN(Pro:ItemKey,Dtl:Item) !Join Product file** **              PROJECT(Pro:Description,Pro:Price)** **             END** **            END** **           END** **          END** ** CODE** ** OPEN(Customer,22h)** ** OPEN(Header,22h)** ** OPEN(Detail,22h)** ** OPEN(Product,22h)** ** SET(Cus:AcctKey)** ** OPEN(ViewOrder)** ** LOOP                           !Process records Loop** **  LOOP                          !Loop to avoid "deadly embrace"** **   HOLD(ViewOrder,1)            !Arm Hold on view, try for 1 second** **   NEXT(ViewOrder)              !Get and hold the record** **   IF ERRORCODE() = 43          !If someone else has it** **    CYCLE                       !and try again** **   ELSE** **    BREAK                       !Break if not held** **   END  ** **  END** **  IF ERRORCODE() THEN BREAK END !Check for end of file** **   !Process the records** ** ****RELEASE****(ViewOrder)            !release held records** ** END** **See Also:** [[hold exclusive record access .htm|HOLD]] [[put re write record .htm|PUT]]