Solved

Cursor add condition

Posted on 2012-03-13
2
372 Views
Last Modified: 2012-03-13
Yes I want to add a condition to my cursor if a row returns blank skip and show the rows that are not blank.  

OPEN tblcur
FETCH NEXT FROM tblcur INTO @tbl
WHILE @@FETCH_STATUS = 0
   BEGIN
EXEC GetInvoice @tbl, @Customer
 FETCH NEXT FROM tblcur INTO @tbl
END
close tblcur
0
Comment
Question by:sevensnake77
2 Comments
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
ID: 37715875
<<Yes I want to add a condition to my cursor if a row returns blank skip and show the rows that are not blank. >>
The definition of the cursor is not here.  

Do you mean when the EXEC GetInvoice returns blank?  Then you must show definition of the stored proc GetInvoice and define what/how you want to 'show' the rows of what table.
0
 
LVL 9

Author Closing Comment

by:sevensnake77
ID: 37716275
use if exists
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now