473,387 Members | 1,510 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,387 software developers and data experts.

What's wrong with the following set of commands and why

Hi,

I am facing some issues with the following set of commands.
The last 'Select' statement gives the error
"SQL0511N The FOR UPDATE clause is not allowed because the table
specified by
the cursor cannot be modified. SQLSTATE=42829

SQL0511N The FOR UPDATE clause is not allowed because the table
specified by the cursor cannot be modified."

Please explain why is this happening?

create table test1(num INTEGER);
create table test2(num2 INTEGER);

insert into test1 values(1);
insert into test2 values(1);

commit;

select test1.num from test1, test2 where test1.num = test2.num2 for
update with RS;

Thanks

Rahul Babbar

Oct 23 '07 #1
2 2299
On Oct 23, 1:11 pm, Rahul Babbar <rahul.babb...@gmail.comwrote:
Hi,

I am facing some issues with the following set of commands.
The last 'Select' statement gives the error
"SQL0511N The FOR UPDATE clause is not allowed because the table
specified by
the cursor cannot be modified. SQLSTATE=42829

SQL0511N The FOR UPDATE clause is not allowed because the table
specified by the cursor cannot be modified."

Please explain why is this happening?

create table test1(num INTEGER);
create table test2(num2 INTEGER);

insert into test1 values(1);
insert into test2 values(1);

commit;

select test1.num from test1, test2 where test1.num = test2.num2 for
update with RS;
[db2inst1@53dbd181 ~]$ db2 "? SQL0511N"
[...]
On the database manager, the result table is read-only if the
cursor is based on a VALUES statement or the SELECT statement
contains any of the following:
[...]
o A FROM clause that identifies one of the following:
- More than one table or view
[...]
/Lennart
Oct 23 '07 #2
On Oct 23, 8:31 pm, Lennart <Erik.Lennart.Jons...@gmail.comwrote:
On Oct 23, 1:11 pm, Rahul Babbar <rahul.babb...@gmail.comwrote:
Hi,
I am facing some issues with the following set of commands.
The last 'Select' statement gives the error
"SQL0511N The FOR UPDATE clause is not allowed because the table
specified by
the cursor cannot be modified. SQLSTATE=42829
SQL0511N The FOR UPDATE clause is not allowed because the table
specified by the cursor cannot be modified."
Please explain why is this happening?
create table test1(num INTEGER);
create table test2(num2 INTEGER);
insert into test1 values(1);
insert into test2 values(1);
commit;
select test1.num from test1, test2 where test1.num = test2.num2 for
update with RS;

[db2inst1@53dbd181 ~]$ db2 "? SQL0511N"
[...]
On the database manager, the result table is read-only if the
cursor is based on a VALUES statement or the SELECT statement
contains any of the following:
[...]
o A FROM clause that identifies one of the following:
- More than one table or view
[...]

/Lennart
However,

The statement
"select test1.num from test1 for
update with RS; "

does work fine....the problem seems to come only if you try to have a
select involving two tables.

Please explain a bit more on the above and what should be done to fix
it?

Rahul

Oct 24 '07 #3

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

Similar topics

1
by: Matthew | last post by:
I am working on a simple text adventure game. I have implemented one word commands and a bit for two words. I have a problem though the movement commands n and s (north and south respectivly) don't...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
12
by: Peter Stojkovic | last post by:
I am now using Beep to make a short warning-sound in my VB-Project What is the aeqivalent command in VS.70, if i dont want use Visual Basic Run-Time Library Members Thanks Peter
16
by: SLIMSHIM | last post by:
Hi, I"m new to c# and .net. I wrote a small program to add rows to an access table. the program goes thru the motions but the data never gets there. here is my code. I am intentionaly not using...
2
by: Paolo Pantaleo | last post by:
Subject: python2.4: Wrong exist status for os.system, os.poepen, etc. Package: python2.4 Version: 2.4.4-2 Severity: normal -- System Information: Debian Release: 4.0 APT prefers testing
20
by: Daniel.C | last post by:
Hello. I just copied this code from my book with no modification : #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0;
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
6
by: sachin | last post by:
Hi, I am facing some strange issue in DB2 UDB 9.5.1 I have created a database on DPF implemented environment and I tried to execute following commands Db2 create table test ( name char(10)...
7
by: Anita Kean | last post by:
Hello I just downloaded the new python2.6 documentation, full of hopes it would solve some basic mysteries for me. I'm new to python, so please forgive my ignorance. I've two questions. 1)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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,...

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.