Advertisement

04.01.2008 at 09:03PM PDT, ID: 23288079
[x]
Attachment Details

Equivalent of declare not_found condition for '02000' from DB2 to Sql server 2005

Asked by cmrnp in DB2 Database, SQL Server 2005

Tags: TSQL

Hi,
I'm looking for an equivalent of the following code
I am in the process of changeover from DB2 to Sqlserver 2005 and am not sure about how to change cursors ( if they even need change ) and condition logic.

I understand that it is to do with errors etc. but not much more than that.
I've also heard of @@error, is that what I should be doing??

If you know of any good websites that would also be great
ThanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
declare @endcursor int = 0
declare not_found condition for '02000'
 
declare cr_exclude cursor for
select f_maj, f_min, f_ctg from rebatesubtype 
where rebatetype = @stype
and upper(rebatesubtype) = 'CASH'
 
 
declare cr_bipcurs cursor for
select agreementno, lineno
from bip
where upper(sampletype) = 'CASH'
 
 
declare continue handler for not_found
  set @endcursor = 1
 
set @sbiptype = 'Cash'
 
open cr_exclude
 
fetch cr_exclude into
@imaj, @imin, @ictg
[+][-]04.01.2008 at 09:56PM PDT, ID: 21260278

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:01PM PDT, ID: 21260289

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:02PM PDT, ID: 21260291

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: DB2 Database, SQL Server 2005
Tags: TSQL
Sign Up Now!
Solution Provided By: appari
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.01.2008 at 10:04PM PDT, ID: 21260299

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:16PM PDT, ID: 21260339

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:25PM PDT, ID: 21260359

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:30PM PDT, ID: 21260371

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.01.2008 at 10:35PM PDT, ID: 21260382

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 04:57AM PDT, ID: 21262044

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2008 at 05:36PM PDT, ID: 21268821

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628