Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 error handling in stored proc

Author  Topic 

shaminda
Starting Member

25 Posts

Posted - 2005-10-31 : 09:29:37
I want to add error handling to the following stored procedures

CREATE PROCEDURE [spSelectPartAS400JTPLOAD]
@PARTNO_1 CHAR(15)

AS
Select * From AS400.dbo.JTPLoad
Where PARTNO = @PARTNO_1 and DABBV not in ('ROBINS','NISSIN','HONR&D')
GO

I access this stored procedure in vb.net program when ever it does not return any records my VB program errors out. How do I fix this problem?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-10-31 : 09:32:04
that's the problem of your vb app not the sproc.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-31 : 13:57:26
Why is it going to "error out" in that piece of code? Time out? Blocking?

If so you're not going to catch those (that I know of) with coding in your Sproc - well, not "straightforward coding" that I can think of!

Kristen
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-10-31 : 14:05:36
>>when ever it does not return any records my VB program errors out

No rows returned is certainly not a sql error. Spirit1 is correct, it sounds like your vb app is not coded to deal with an empty result set as a possiblity.

Be One with the Optimizer
TG
Go to Top of Page

shaminda
Starting Member

25 Posts

Posted - 2005-10-31 : 16:47:52
Thank you all for your help. As spirit1 recomended I checked
if the row count was zero in my VB code and it doesn't error out any more.
Go to Top of Page
   

- Advertisement -