473,554 Members | 2,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL-procedure-statement ....

This is regarding SQL stored procedures. The guide says this about handler
declaration in SQL procedures:

"handler declaration can specify a SQL-procedure-statement.
SQL-procedure-statement is a set of statements that execute when the
handler receives control."

But I don't understand how a 'set of statements' can be specified as a
SQL-procedure-statement when UDB does not allow nested compound
statements.

Also, any idea why I cannot use the following in SQL procedure:

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION GOTO ERROR_HANDLE;

The above line gives an error during CREATE PROCEDURE: SQL0104N - An
unexpected token GOTO was found; expected tokens may include SET.

Thanks.
Raquel.

Nov 12 '05 #1
4 3530
Continuing with the above question, at one place, the manual states that
both the SQLSTATE and SQLCODE variables can be declared only in the
'outermost' compound statement of the SQL procedure.

And then, it of course says that compund statements cannot be nested.

If they cannot be nested, what does 'outermost' compound statement mean?

Think I am missing some fundamental here.

TIA
Raquel.

Nov 12 '05 #2
"Raquel" <ra****@nospam. com> wrote in message
news:fe******** *************** *******@localho st.talkaboutdat abases.com...
This is regarding SQL stored procedures. The guide says this about handler
declaration in SQL procedures:

"handler declaration can specify a SQL-procedure-statement.
SQL-procedure-statement is a set of statements that execute when the
handler receives control."

But I don't understand how a 'set of statements' can be specified as a
SQL-procedure-statement when UDB does not allow nested compound
statements.

Also, any idea why I cannot use the following in SQL procedure:

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION GOTO ERROR_HANDLE;

The above line gives an error during CREATE PROCEDURE: SQL0104N - An
unexpected token GOTO was found; expected tokens may include SET.

Thanks.
Raquel.


I would recommend the following book on stored procedures;
"DB2 SQL Procedural Language for Linux, UNIX, and Windows"
By Paul Yip, Drew Bradstock, Hana Curtis, Michael Gao, Zamil Janmohamed,
Clara Liu, Fraser McArthur
Published by Prentice Hall PTR.

You can download Chapter 5. "Exception Handling" for free at:
http://www-106.ibm.com/developerwork...p/splbook.html
Nov 12 '05 #3
Raquel wrote:
This is regarding SQL stored procedures. The guide says this about handler
declaration in SQL procedures:

"handler declaration can specify a SQL-procedure-statement.
SQL-procedure-statement is a set of statements that execute when the
handler receives control."

But I don't understand how a 'set of statements' can be specified as a
SQL-procedure-statement when UDB does not allow nested compound
statements.

Also, any idea why I cannot use the following in SQL procedure:

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION GOTO ERROR_HANDLE;

The above line gives an error during CREATE PROCEDURE: SQL0104N - An
unexpected token GOTO was found; expected tokens may include SET.

Thanks.
Raquel.

Try GO TO as two words.
Nov 12 '05 #4
Had tried GO TO even earlier but didn't help. Anyway, thank you so much for
an earlier post on dbforms.com which helped me solve another nagging
problem I was facing for Create procedures (SQL1131N).

Regards,
Raquel.

Nov 12 '05 #5

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

Similar topics

10
6722
by: Dagwood | last post by:
Good morning: At least it's morning where I am. :) I have a rather newbie question I'm afraid. I have VisualStudio.NET, and have installed it along with SQL server. However I can't seem to find an administration front-end to SQL, other than the VisualStudio, which is ok for creating databases and adding tables/columns. However when I go...
2
15211
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000 Personal disk from the SQL Server 2000 Enterprise kit as this is reported here on the MSDN web site to be the version that is supported on Windows XP. ...
9
669
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create a server group. I right click on the "SQL Server Group" and make a name of "TEST" and put in the subgroup of "SQL Server Group". Next, I try to...
0
4103
by: AlessanBar | last post by:
Hello Friends !! I have a strange problem, and I need to know what would be the source of this. I have a laptop computer with the following configuration: Pentium III Brand : Toshiba Speed : 500 Mhz RAM : 192 MB Hard Disk : 6 GB
1
6607
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an unexpected value. ***EndOfSession***? Microsoft SQL Server...
3
2219
by: datapro01 | last post by:
I am a DB2 DBA that has been asked to become familiar enough with SQL Server in order to become actively involved in its installation, implementation, and to review database backup/recovery procedures. SQL Server will be used by a vendor packaged application. The problem is that we are awaiting word on whether it will be SQL Server 2000 or...
16
2303
by: Jeremy S. | last post by:
I'm about to install VS.NET 2005 and SQL Server 2005 on a new/clean development machine (XP Pro/SP2 etc). Is the order of installation important (i.e., which product should I install first)? Thanks!
10
2081
by: amjad | last post by:
how to connection sql server table with aspx like pulling data from table to grid view.... simple example to start .... thanks
6
2480
by: Fuzzydave | last post by:
I am back developing futher our Python/CGI based web application run by a Postgres DB and as per usual I am having some issues. It Involves a lot of Legacy code. All the actual SQL Querys are stored in the .py files and run in the .cgi files. I have the problem that I need to construct a row from two seprate SQL Querys, I have tried...
14
3007
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can anyone please help me with this as I want to install SQL server and also wouold be grateful, if you can suggest me any workaround to dealwith this...
0
7600
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...
0
7521
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...
0
7802
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. ...
0
6145
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5436
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...
0
5155
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...
0
3560
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...
1
2020
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1134
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.