Progress
Programming
Handbook


Disconnecting Databases

By default, Progress disconnects all databases at the end of a session. You can explicitly disconnect a database with the DISCONNECT statement, which has the following syntax:

SYNTAX
DISCONNECT logical-database-name 

The logicaldatabasename represents the logical name of a connected database. It can be an unquoted string, a quoted string, or a character expression.

A DISCONNECT statement does not execute until all active procedures that reference the database end or stop.

mainprc1.p
CONNECT -db mydb -1. 
RUN p-subproc1.p. 

subproc1.p
RUN subproc2.p. 
FOR EACH mydb.customer: 
  UPDATE name address city state postal-code. 
END. 

subproc2.p
DISCONNECT mydb. 

In these procedures, the mydb database is not disconnected until the end of the p-subproc1.p procedure.


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