Using Break in a nexted Query

Posted on 2014-02-18
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  :-)
Question by:ZURINET
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
LVL 35

Expert Comment

by:David Todd
ID: 39869560

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.


Accepted Solution

ZURINET earned 0 total points
ID: 39869619
just solved it

 WHILE (@Flag < @counterCheck)
	SET @Flag		= @Flag	+ 1
	SET @PositionNr	= @PositionNr + 1								

Open in new window

LVL 35

Expert Comment

by:David Todd
ID: 39869673

That's cool that you've solved it!


Author Closing Comment

ID: 39880411
Just solved it

Featured Post

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 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