How are database errors handled in TCL?
Submitted by admin on Sun, 2005-11-06 02:43.
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
}»
- Login to post comments

