How can I make sure the $rc is always created and filled with a usefull value.
My current statement:
if { [catch {set rc [odbc SQLAllocHandle SQL_HANDLE_STMT $hdbc hstmt]} err]
||
![cequal $rc “SQL_SUCCESS”] }
{
gc_dbHandleODBCError “SQLAllocHandle ($rc)” $henv $hdbc $hstmt
}
The above statement results in the following error if the database connection can’t be established:
result = ‘can’t read “rc”: no such variable’
errorInfo: ‘
can’t read “rc”: no such variable
while executing
“gc_dbHandleODBCError “SQLAllocHandle ($rc)” $henv $hdbc $hstmt”
Diana
LUMC -Leiden University Medical Centre
The Netherlands