How are database errors handled in TCL?

After each OCI command the "rc" variable are set to either 0 for successfull execution, or the Oracle server error. OraTcl maintains a Tcl global array called "oramsg" that provides information on Oracle server error messages.

oralogon scott/tiger
if {$oramsg(rc) != ""} {
	puts stderr "Unable to connect to database:"
	puts stderr "  Error Code = ORA-$oramsg(rc)"
	puts stderr "  Error Message = $oramsg(errortxt"
    exit
}