473,785 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stop query in QA from continuing

Greetings everyone!

Is there a way to stop query analyzer from processing remaining query
statements? Let's say i have the following query in query analyzer:

query statements
if condition
begin
query statements
stop the query
end

query statements
if condition
begin
query statements
stop the query
end

is there a way to stop the query from executing the statements in the
second query when the first condition is met?

i have searched BOL and google but i couldn't find anything. I hope
anybody out there can help me.

BTW, i'm executing this statements directly in QA, not from within my
program. The query statement and if condition pair is plenty. i guess i
can use an else statement but it would be nested too deep. if there is
a simpler way to do it please point me to the right direction or to any
link that'll get me going.

Thanks in advance.

diego

Jan 7 '07 #1
3 2350
You can use GOTO. It will look like this:

query statements
if condition
begin
query statements
GOTO ExitQuery
end

query statements
if condition
begin
query statements
GOTO ExitQuery
end

ExitQuery:
GO

Be aware that GOTO cannot go to a label outside of the batch.

Regards,

Plamen Ratchev
http://www.SQLStudio.com

"diego" <di******@yahoo .comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
Greetings everyone!

Is there a way to stop query analyzer from processing remaining query
statements? Let's say i have the following query in query analyzer:

query statements
if condition
begin
query statements
stop the query
end

query statements
if condition
begin
query statements
stop the query
end

is there a way to stop the query from executing the statements in the
second query when the first condition is met?

i have searched BOL and google but i couldn't find anything. I hope
anybody out there can help me.

BTW, i'm executing this statements directly in QA, not from within my
program. The query statement and if condition pair is plenty. i guess i
can use an else statement but it would be nested too deep. if there is
a simpler way to do it please point me to the right direction or to any
link that'll get me going.

Thanks in advance.

diego

Jan 7 '07 #2
Thank you.

Ayon kay Plamen Ratchev:
You can use GOTO. It will look like this:

query statements
if condition
begin
query statements
GOTO ExitQuery
end

query statements
if condition
begin
query statements
GOTO ExitQuery
end

ExitQuery:
GO

Be aware that GOTO cannot go to a label outside of the batch.

Regards,

Plamen Ratchev
http://www.SQLStudio.com

"diego" <di******@yahoo .comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
Greetings everyone!

Is there a way to stop query analyzer from processing remaining query
statements? Let's say i have the following query in query analyzer:

query statements
if condition
begin
query statements
stop the query
end

query statements
if condition
begin
query statements
stop the query
end

is there a way to stop the query from executing the statements in the
second query when the first condition is met?

i have searched BOL and google but i couldn't find anything. I hope
anybody out there can help me.

BTW, i'm executing this statements directly in QA, not from within my
program. The query statement and if condition pair is plenty. i guess i
can use an else statement but it would be nested too deep. if there is
a simpler way to do it please point me to the right direction or to any
link that'll get me going.

Thanks in advance.

diego
Jan 7 '07 #3
You could also use "RETURN".

-Dave
http://www.markleconsulting.com

diego wrote:
Thank you.

Ayon kay Plamen Ratchev:
You can use GOTO. It will look like this:

query statements
if condition
begin
query statements
GOTO ExitQuery
end

query statements
if condition
begin
query statements
GOTO ExitQuery
end

ExitQuery:
GO

Be aware that GOTO cannot go to a label outside of the batch.

Regards,

Plamen Ratchev
http://www.SQLStudio.com

"diego" <di******@yahoo .comwrote in message
news:11******** **************@ 11g2000cwr.goog legroups.com...
Greetings everyone!
>
Is there a way to stop query analyzer from processing remaining query
statements? Let's say i have the following query in query analyzer:
>
query statements
if condition
begin
query statements
stop the query
end
>
query statements
if condition
begin
query statements
stop the query
end
>
is there a way to stop the query from executing the statements in the
second query when the first condition is met?
>
i have searched BOL and google but i couldn't find anything. I hope
anybody out there can help me.
>
BTW, i'm executing this statements directly in QA, not from within my
program. The query statement and if condition pair is plenty. i guess i
can use an else statement but it would be nested too deep. if there is
a simpler way to do it please point me to the right direction or to any
link that'll get me going.
>
Thanks in advance.
>
diego
>
Jan 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3163
by: Jeff Connelly | last post by:
Doing a "Find in Files" in Visual C# - results going to a results window. For long searches, is there a way to stop it from continuing the search?
2
1531
by: August | last post by:
In my continuing attempt to make a user module for my CMS work, I keep running into errors with the folowing query, which makes no sense to me at all: INSERT IGNORE INTO mos_comprofiler(id,user_id) SELECT id,id FROM mos_users"; where mos_comprofiler is a new parallel User DB and mos_users is the original database of users. This first query is supposed to work when there is a id column in mos_users. However, my mos_users table has a...
1
3824
by: Ranga | last post by:
Hi, I am getting the following error when i am using query no in my sql statement and compiling the stored proc. I am doing this on Unic UDB DB2. Please let me know if i am mising something here. ---------------------------Error Message -------------------------------------- Begin Customization of Profile: Profile name is: SP_DEL_TOTE_ITEM_SJProfile0 Failed to online-check the following statement:
8
3523
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with inline code. The page has a Datagrid, a textbox and a button. When the button is clicked, the value of the textbox is inserted into the table whose contents are displayed on the page. The problem occurs when I set a breakpoint on a line *IN*...
5
1780
by: Adrian Parker | last post by:
Say I have a form with several fields on it, some of which cause postbacks when changed. How can I stop the user from continuing to type data into the other fields while the server is still processing the postback ? -- Adrian Parker Ingenuity At Work Ltd
0
1387
by: Saran | last post by:
Hi, I am having a method that handles the click event of a button on the page. This method will also send an email. Sending email comes after several lines of code in the method. I was testing upper part of the method, so i kept a break point in the upper part. The code execution comes to a break in that point. I examined the values and clicked "stop debugging" i.e., well before calling send email. But strangely it continued to send the...
11
47195
by: sphinney | last post by:
At the risk of oversimplifying my situation, here are the basic facts: * I'm writing an ACCESS 2002 VBA. * My VBA automatically uses information in one table (Table A) to repeatedly query a second table (Table B) via SQL. * Each record in Table A (which has about 800 records) represents a set of conditions by which to query Table B. * The VBA analyzes the recordset returned by the query of Table B, and writes the results back...
6
6870
by: Phil Stanton | last post by:
I am running a query that calls a function used to format addresses depending on the width of a control on a report that shows that address. The same query is used as the RecordSource of lots of similar reports, but all with different sized Address text boxes. For the function to work, the report need to be open in design view, so that the Text Box Width can be "measured". The function is obviously called for each line of the query (about...
1
4326
by: Shaba99 | last post by:
Hey everyone, New to this forum, but i search for answers here often. I have a c# windows application which embeds windows media player on the form. The application (biz rule) requires that the user plays the media file before continuing and saving the file. i would do this by insuring that the currentposition in the file being played is not = 0. However, if the user clicks the stop button in media player, the position goes to 0...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.