473,399 Members | 3,656 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,399 software developers and data experts.

udb cursor (or curser)

I'm not that familiar with UDB, so apologies for my naivety.

One of our developers approached me with a sql question. I thought a cursor
loop would do the job - but I had difficulty getting a simple template to work.

Can one use cursors within a file like this ?
$ db2 -tvf cursor
DECLARE table_cursor CURSOR FOR SELECT name FROM sysibm.systables
DB20000I The SQL command completed successfully.

OPEN table_cursor
DB20000I The SQL command completed successfully.

FETCH table_cursor
DB21030E The cursor "TABLE_CURSOR" has not been opened.


Any constructive advice most welcome, thanks.
Nov 12 '05 #1
2 3133
why not put the steps in a stored procedure and execute the procedure.
regards,
dotyet

Nov 12 '05 #2
MCPHEAL wrote:
I'm not that familiar with UDB, so apologies for my naivety.

One of our developers approached me with a sql question. I thought a cursor
loop would do the job - but I had difficulty getting a simple template to work.

Can one use cursors within a file like this ?

$ db2 -tvf cursor
DECLARE table_cursor CURSOR FOR SELECT name FROM sysibm.systables
DB20000I The SQL command completed successfully.

OPEN table_cursor
DB20000I The SQL command completed successfully.

FETCH table_cursor
DB21030E The cursor "TABLE_CURSOR" has not been opened.

Any constructive advice most welcome, thanks.

Try this:
db2 +c -tvf cursor
By default CLP operates under auto-commit so your cursor (not being
defined as WITH HOLD) closed right after being opened.
+c suspends auto commit

Cheers
Serge
Nov 12 '05 #3

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

Similar topics

1
by: Kidus Yared | last post by:
I am having trouble with the cursor in a richtextbox for windows forms. After incerting a character between words in a sentence, as so: this.richTextBox1.Text =...
1
by: K B | last post by:
Silly question but I can't find the answer. I have linkbuttons and I've noticed that the mouse cursor doesn't change to a hand or an arrow when I mouse over it...it just stays an i-beam. I'm just...
1
by: Gap | last post by:
Hello all, I want to create a page with an image and when the cursor is moving over the image (e.g. over text on the image the text is highlighted or changes color or something similar. So that...
1
by: kallol | last post by:
Hi Everyone, I have a form designed with a table and the table is inside a <div> (Required. Can’t get rid of it). The div has style “height: 100% and scrollable: auto”. The issue: In IE, let...
2
by: SambitkMishra | last post by:
I want to know what is ref-Cursor and what is use of ref-Cursor with a Example. Sambit
0
by: gpspocket | last post by:
help me -CURSOR backward insert from End Date > to Start Date how to insert dates from end to start like this SELECT 111111,1,CONVERT(DATETIME, '17/03/2008', 103), CONVERT(DATETIME,...
1
by: Simon | last post by:
Dear reader, How can I move the curser from one field to the next field in the record after an action triggered by the event After click. The form is of the type Datasheet. The next code...
1
by: nortonwho | last post by:
My ISP recently updated their home page. Now when I launch, the curser starts in the Google search window instead of the address window. I then inadvertantly do a google search on the address...
0
by: =?Utf-8?B?bGFycnk=?= | last post by:
my curser keeps jumping back while typing since the update its getting worse
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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,...

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.