If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2V7. DECLARE EXIT HANDLER in function not working

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-04, 01:36
deepaka deepaka is offline
Registered User
 
Join Date: Jan 2004
Posts: 20
db2V7. DECLARE EXIT HANDLER in function not working

Hi All,

I have

DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
in a db2 function. The function does not compile and gives me an error message saying

administrator.FUNCTION1: 11: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQ" was found following "ic declare tmp int; ". Expected tokens may include: "<space>". LINE NUMBER=11. SQLSTATE=42601


What is going wrong. The function body is

CREATE function test()
returns int
LANGUAGE SQL
begin atomic
declare tmp int;
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
BEGIN
end
return 1;
end
Reply With Quote
  #2 (permalink)  
Old 01-30-04, 03:36
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: db2V7. DECLARE EXIT HANDLER in function not working

I assume this statement is only for SPs ...

Please read the db2 documentation to confirm ..

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On