473,324 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Are nested cursors possible in DB2?

Is something like this possible ? I guess not...since I get an error due to the while statement within a cursor block. Each of the cursor block individually runs fine.

Expand|Select|Wrap|Line Numbers
  1. declare c1
  2. open c1
  3. fetch from c1 into
  4. while (SQLSTATE = '00000') do
  5.    declare c2
  6.    open c2
  7.    fetch from c2 into
  8.    while (SQLSTATE = '00000') do
  9.    any OPERTATION
  10.    fetch from c2
  11.    end while
  12.    close c2
  13. fetch from c1
  14. end while
  15. close c1
Feb 5 '11 #1
1 7313
Yes it works. Except that the the declaration of the second cursor c2 should be right on top. :)
Feb 5 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Alban Hertroys | last post by:
Oh no! It's me and transactions again :) I'm not really sure whether this is a limitation of psycopg or postgresql. When I use multiple cursors in a transaction, the records inserted at the...
12
by: Jeff Lanfield | last post by:
First of all, I apologize if coalescing is not the right term to describe my problem. I have a tree where each node has the same set of attributes (is the same entity) but child nodes should...
3
by: r rk | last post by:
I am trying to write a utility/query to get a report from a table. Below is the some values in the table: table name: dba_daily_resource_usage_v1...
5
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select...
18
by: Rhino | last post by:
I am having a problem with a nested SQL Procedure on DB2 V8.2.1 on Windows. This simple-looking proc is giving me this error message when I try to build it in the Development Center: ...
2
by: smauldin | last post by:
Why does the execution plan have a nested loop join for a simple select with an UDF in the where clause? Here is the query: select * from test_plan where vCol = my_udf('test') Here is the...
17
by: vishal | last post by:
I am new to sql and require some help on cursors? what are they and how and why are they used for??? it will be kind enough if anyone helps me in this regards.. regards vishal jain.
0
by: Nobody | last post by:
Is it possible to have nested datasources? I have a page that I want laid out like this: rptCategories ==Category 1 rptItems ==Item 1 rptCategories ==Category 2 rptItems ==Item 1...
0
ADezii
by: ADezii | last post by:
A Cursor, in ADO, is the underlying Object that makes it possible to move around within the set of rows returned by a Recordset. The Cursor manages movement, updatability, and currency of the rows...
0
by: Scal | last post by:
Hello everyone; I try to create a web user control that has a Repeater (not that hard) to which I can add programmatically a new Repeater into ItemTemplate part. The point being to be able to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.