Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you force Timing Out Using Stored Procedures?

Status
Not open for further replies.

JeremyM

Programmer
Nov 10, 2000
33
0
0
US
I have a stored procedure call to DB2. Sometimes it errors. I want to continue the rest of the code if it does, not crash the system. Does anyone know how to do this using VB 6.0? Or does it need to be done on the DB2 side?

Any help would be appreciated.

Thanks,

Jeremy Gardner
Programmer
Texas Legislative Council
 
My DBA has stored procs that do the same thing sometimes, here's what I do:

lError = 0

On Error Resume Next
Set oRecordSet = oCommand.Execute
lError = err.Number
On Error GoTo 0 (or whatever error handler you have)

If lError <> 0 then
'continue on, no errors
Else
'handle the error
End If

Hope this helps. -Chris Didion
Matrix Automation, MCP
 
It sounds as if you want to trap an error in a DB2 stored proc, then continue with executing more of the stored proc code.

If so, you need to handle this in the stored proc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top