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 > do db2 have unnamed procedure like oracle?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-15-06, 05:21
welyngj welyngj is offline
Registered User
 
Join Date: Feb 2004
Posts: 15
do db2 have unnamed procedure like oracle?

do db2 have unnamed procedure like oracle?
for example:
in oracle,this code can be executed:
declare
..
begin
...
end;
but in db2,it seems it cannot be executed.
do anyone have some advice?
My task is to be responsible for converting oracle code to db2 code.
can you help me in this question?
thanks in advance
Reply With Quote
  #2 (permalink)  
Old 09-15-06, 08:03
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
i dont get what you are looking about, if you dont want SP and want multiple SQL statements to process u can execute compound sql statements by :

BEGIN ATOMIC
DECLARE cntr SMALLINT DEFAULT 1;
FOR V1 AS
SELECT id as idval
FROM staff
WHERE id < 80
ORDER BY id
DO
UPDATE staff
SET comm = cntr
WHERE id = idval;
SET cntr = cntr + 1;
END FOR;
END

--Rahul Singh
Reply With Quote
  #3 (permalink)  
Old 09-17-06, 22:14
welyngj welyngj is offline
Registered User
 
Join Date: Feb 2004
Posts: 15
Thanks very much for your help.
you are kind...
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