Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Break in a nexted Query

Posted on 2014-02-18
4
Medium Priority
?
161 Views
Last Modified: 2014-02-23
Hi all
I have a while loop in a nexted query

1: Query do some proccessing.. Control checks
2: If the check is okay.. Get values..
3: Insert values until I have reach the maximum (Since I have break here.. My code stops)
4: clean up isolated transaction and write a report.

How can I continue to step 4, given that I am using the while loop  on step 3.

Thanks in Advance..

Sorry I am not a native speaker  :-)
0
Comment
Question by:ZURINET
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 39869560
Hi,

Are steps 1 - 4 in the loop, or just step 3?

Any chance of posting the code - its just that there are a number of different ways to test for the end of loop or continue in loop conditions, and without seeing your code I'm more likely to be wrong than right.

Regards
  David
0
 

Accepted Solution

by:
ZURINET earned 0 total points
ID: 39869619
sorry 
just solved it

 WHILE (@Flag < @counterCheck)
	 BEGIN								 
	
	-- SQL STATEMENT				
	SET @Flag		= @Flag	+ 1
	SET @PositionNr	= @PositionNr + 1								
	END		

Open in new window

0
 
LVL 35

Expert Comment

by:David Todd
ID: 39869673
Hi,

That's cool that you've solved it!

Regards
  David
0
 

Author Closing Comment

by:ZURINET
ID: 39880411
Just solved it
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 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