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

the problem about load from cursor

Be consider of efficiency, I want to use "load from cursor " instead of
"insert into ... select ..."
so I write sql sentence like following:
declare mycor cursor for select a.a, a.b from table1 a , table2 b where
a.a=b.a and a.b=b.b with ur; --column a and b in
table1,table2 both are primary key
then
load from mycor of cursor insert into table2(a, b)

but this operation will get a error message:
SQL0668N Operation not allowed for reason code "3" on table "table2"
SQLSTATE=57016

I think it because the target table has been used in select sentence,
but I use "with ur" already!
Who can tell me why or how to implement it in another efficiency way ?

Thanks for any suggestion!

Feb 11 '06 #1
2 2930
nier wrote:
Be consider of efficiency, I want to use "load from cursor " instead of
"insert into ... select ..."
so I write sql sentence like following:
declare mycor cursor for select a.a, a.b from table1 a , table2 b where
a.a=b.a and a.b=b.b with ur; --column a and b in
table1,table2 both are primary key
then
load from mycor of cursor insert into table2(a, b)

but this operation will get a error message:
SQL0668N Operation not allowed for reason code "3" on table "table2"
SQLSTATE=57016

I think it because the target table has been used in select sentence,
but I use "with ur" already!
Who can tell me why or how to implement it in another efficiency way ?

Check out the ALLOW READ ACCESS mode of LOAD.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 11 '06 #2
Thanks very much, now it's OK.

Feb 15 '06 #3

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

Similar topics

5
by: Firehawk® | last post by:
Hi, I have a great experience with DB (Oracle and others) and I am using DB2 now. Then, I have few questions: 1. How drop a schema (user) and all objects of this schema, like a Oracle "drop...
7
by: jane | last post by:
I'm going to use cursor load to load 200GB data in my production database. My database has 2 partitions. but I cannot find more info in the manual about this cursor load. I'm concern about...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
2
by: Paul Cheetham | last post by:
Hi, I am trying to load a custom cursor from my programs resources. I have successfully included the cursor resource, and I have confirmed that the name I am using is correct. Below is the...
5
by: Paul Cheetham | last post by:
Hi, I have some custom colour cursors which I have added to my c# project, and set them to be compiled as "Embedded Resource" It seems impossible to load a colour cursor using the standard...
10
by: technocrat | last post by:
Hi, I am trying to declare and cursor and thn load from that cursor into another table. Since I have almost 4 million records, I cant do it without the cursor which reduces the time by almost...
7
by: P. Adhia | last post by:
Sorry for quoting an old post and probably I am reading out of context so my concern is unfounded. But I would appreciate if I can get someone or Serge to confirm. Also unlike the question asked in...
1
by: peteh | last post by:
Hi All; I have a 2.5mm row table (very wide columns) on an UDB v8.2.3 (DPF - 6x10) AIX box. We were doing some performance testing to determine the pros and cons of delete/insert vs load from...
1
by: Ultrak The DBA | last post by:
UDB Version 8.2 FP7 (r"DB2 v8.1.1.128", "s061108", "U810098", and FixPak "14".) 64 bit running on AIX 5.3. We were getting the SQL0668 error below so we put the status sql into the script 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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.