Previous Topic: &NDBADD

Next Topic: &NDBCTL


&NDBCLOSE

Signs off (disconnects) from an NDB database.

&NDBCLOSE dbname

The &NDBCLOSE statement is used to terminate the connection an NCL procedure has with an NDB. All current formats, sequences, scan lists an so on, are deleted. If further access to the database is desired, the procedure must issue an &NDBOPEN statement.

Operands:

dbname

The name of the NDB from which you want to sign off is a required operand. If not signed on to this NDB, an error response is given, that might cause the procedure to terminate, depending on the &NDBCTL ERROR= setting.

Examples: &NDBCLOSE

&NDBCLOSE MYNDB

This example signs off from the NDB called MYNDB. Any defined formats and sequences are deleted.

Notes:

An implicit &NDBCLOSE is done at NCL procedure termination for all open NDBs. (This is only at highest-level termination, not nested EXECs.)

Any active &NDBxxx START/DATA/END statements for this database are terminated, as if &NDBxxx CANCEL was specified.

If the procedure is not currently signed on the NDB, response 35 is returned, and the procedure is terminated if the current &NDBCTL ERROR setting is ABORT.

If the database was not started, or is in stopping status, and this is the last user signing off, the database stops, and may enter the LOCKED status.

Note: See also the NDB START and NDB STOP commands in the Online Help.