473,669 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL0746N: Routine violated nested SQL statement rules when attemptingto perform operation "MODIFY" on table

Ion
Hi, I get SQL0746N when trying to call stored procedure. In my
particular case I the message complains about operation "READ", but
I'm posting a simplified version that results in SQL0746N with
"MODIFY". I assume there is a similar reason, but I'm not quite sure
what I'm doing wrong here. Any idea?
I'm running 9.5 SP 0 on windows.
Thank you!
create table t(Id int not null primary key generated by default as
identity, name varchar(100) not null)@

Create Procedure t_Insert(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
insert into t(name) values(pName);
end @
Create Procedure t_InsertCall(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
Call t_Insert(pName) ;
end @

begin atomic
declare @UserTypeId int;
Call t_InsertCall( 'a name' );
Call t_InsertCall( 'another name');
end@
Nov 12 '08 #1
5 3569
Ion wrote:
Hi, I get SQL0746N when trying to call stored procedure. In my
particular case I the message complains about operation "READ", but
I'm posting a simplified version that results in SQL0746N with
"MODIFY". I assume there is a similar reason, but I'm not quite sure
what I'm doing wrong here. Any idea?
I'm running 9.5 SP 0 on windows.
Thank you!
create table t(Id int not null primary key generated by default as
identity, name varchar(100) not null)@

Create Procedure t_Insert(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
insert into t(name) values(pName);
end @
Create Procedure t_InsertCall(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
Call t_Insert(pName) ;
end @

begin atomic
declare @UserTypeId int;
Call t_InsertCall( 'a name' );
Call t_InsertCall( 'another name');
end@
You have a mutating table conflict.
Try this one:
db2set DB2_RESOLVE_CAL L_CONFLICT=ALL
and retreat DB2. No promised. It's geared towards CALL in trigger and
SQL Table functions.
But it's worth a shot.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 12 '08 #2
Ion
On Nov 12, 12:26*pm, Serge Rielau <srie...@ca.ibm .comwrote:
Ion wrote:
Hi, I get SQL0746N when trying to call stored procedure. In my
particular case I the message complains about operation "READ", but
I'm posting a simplified version that results in SQL0746N *with
"MODIFY". I assume there is a similar reason, but I'm not quite sure
what I'm doing wrong here. *Any idea?
I'm running 9.5 SP 0 on windows.
Thank you!
create table t(Id int not null primary key generated by default as
identity, name varchar(100) not null)@
Create Procedure t_Insert(
* *pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
* *insert into t(name) values(pName);
end @
Create Procedure t_InsertCall(
* *pName varchar(255)
) LANGUAGE SQL *modifies sql data
BEGIN
* *Call t_Insert(pName) ;
end @
begin atomic
declare @UserTypeId int;
* *Call t_InsertCall( 'a name' );
* *Call t_InsertCall( 'another name');
end@

You have a mutating table conflict.
Try this one:
db2set DB2_RESOLVE_CAL L_CONFLICT=ALL
and retreat DB2. No promised. It's geared towards CALL in trigger and
SQL Table functions.
But it's worth a shot.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Thanks,
I tried both YES and NO with no luck though
Apparently ALL is not a valid value for that setting. Or at least for
my DB2 version
db2level
DB21085I Instance "DB2" uses "32" bits and DB2 code release
"SQL09050" with
level identifier "03010107".
Informational tokens are "DB2 v9.5.0.808", "s071001", "NT3295", and
Fix Pack "0".

Nov 12 '08 #3
Ion wrote:
On Nov 12, 12:26 pm, Serge Rielau <srie...@ca.ibm .comwrote:
>Ion wrote:
>>Hi, I get SQL0746N when trying to call stored procedure. In my
particular case I the message complains about operation "READ", but
I'm posting a simplified version that results in SQL0746N with
"MODIFY". I assume there is a similar reason, but I'm not quite sure
what I'm doing wrong here. Any idea?
I'm running 9.5 SP 0 on windows.
Thank you!
create table t(Id int not null primary key generated by default as
identity, name varchar(100) not null)@
Create Procedure t_Insert(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
insert into t(name) values(pName);
end @
Create Procedure t_InsertCall(
pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
Call t_Insert(pName) ;
end @
begin atomic
declare @UserTypeId int;
Call t_InsertCall( 'a name' );
Call t_InsertCall( 'another name');
end@
You have a mutating table conflict.
Try this one:
db2set DB2_RESOLVE_CAL L_CONFLICT=ALL
and retreat DB2. No promised. It's geared towards CALL in trigger and
SQL Table functions.
But it's worth a shot.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Thanks,
I tried both YES and NO with no luck though
Apparently ALL is not a valid value for that setting. Or at least for
my DB2 version
db2level
DB21085I Instance "DB2" uses "32" bits and DB2 code release
"SQL09050" with
level identifier "03010107".
Informational tokens are "DB2 v9.5.0.808", "s071001", "NT3295", and
Fix Pack "0".
Hmm, maybe FP1... Can you wrap the compound into a procedure?
That'll fix the problem at the root.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 12 '08 #4
Ion
On Nov 12, 2:06*pm, Serge Rielau <srie...@ca.ibm .comwrote:
Ion wrote:
On Nov 12, 12:26 pm, Serge Rielau <srie...@ca.ibm .comwrote:
Ion wrote:
Hi, I get SQL0746N when trying to call stored procedure. In my
particular case I the message complains about operation "READ", but
I'm posting a simplified version that results in SQL0746N *with
"MODIFY". I assume there is a similar reason, but I'm not quite sure
what I'm doing wrong here. *Any idea?
I'm running 9.5 SP 0 on windows.
Thank you!
create table t(Id int not null primary key generated by default as
identity, name varchar(100) not null)@
Create Procedure t_Insert(
* *pName varchar(255)
) LANGUAGE SQL modifies sql data
BEGIN
* *insert into t(name) values(pName);
end @
Create Procedure t_InsertCall(
* *pName varchar(255)
) LANGUAGE SQL *modifies sql data
BEGIN
* *Call t_Insert(pName) ;
end @
begin atomic
declare @UserTypeId int;
* *Call t_InsertCall( 'a name' );
* *Call t_InsertCall( 'another name');
end@
You have a mutating table conflict.
Try this one:
db2set DB2_RESOLVE_CAL L_CONFLICT=ALL
and retreat DB2. No promised. It's geared towards CALL in trigger and
SQL Table functions.
But it's worth a shot.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Thanks,
I tried both YES and NO with no luck though
Apparently ALL is not a valid value for that setting. Or at least for
my DB2 version
db2level
DB21085I *Instance "DB2" uses "32" bits and DB2 code release
"SQL09050" with
level identifier "03010107".
Informational tokens are "DB2 v9.5.0.808", "s071001", "NT3295", and
Fix Pack "0".

Hmm, maybe FP1... Can you wrap the compound into a procedure?
That'll fix the problem at the root.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Right, wrapping the compound in a stored procedure works fine.
However, I have plenty of similar occurrences in a large script, it's
a bit of a pain to do so
Nov 12 '08 #5
Ion wrote:
Right, wrapping the compound in a stored procedure works fine.
However, I have plenty of similar occurrences in a large script, it's
a bit of a pain to do so
FWIW DB2 vNext will support full SQL PL in compounds.
So you can write 2MB scripts with all the nested calls and UDIs in them
you like.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 12 '08 #6

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

Similar topics

2
3222
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
6
4991
by: Anon | last post by:
I have a table with a cell. The cell's ID is created using a unique name that is held in m_UniqueCellName and the cell is created like so... document.write( "<TD ID="' + m_UniqueCellName + '"></TD>" ); How can I programmatically modify the contents of the cell whose name is held within m_UniqueCellName? The variable will get passed around to other functions, but try as I might,
2
4977
by: Jozef | last post by:
I'm using Access XP. I'm trying to create a table, modify a table, create in index, and create a relationship in a remote database in code from the program database. I know how to create and manipulate resident tables using code but not a remote or attached database. Any help you could provide would be greatly appreciated
13
2507
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
2
4407
by: John Bokma | last post by:
I am quite new to MS SQL, and I want to read rows from a todo table, and when a row has been processed, I want to delete that row. Ages ago in MySQL I would probably have locked the table, select, process a row, delete a row, unlock the table. I have been reading through the documentation from MS SQL, but it's not clear what exactly I should do. Since I want to lock only one table in the select (the others just provide
4
2489
by: J Rice | last post by:
I have been experimenting with some thread programming, but as I'm doing this on my own I am worried I might be making a major mistake. Here's a brief rundown of what I am working on. Multiple threads, via Queue, are used to perform RBL checks on an IP. The threads are passed a defined class (ConnectionScore) in their init. This is used to collect the results, including a method to add the result. If I run the program, everything...
3
1765
by: ken | last post by:
I have a field in table "Jobs" called "JobNo" consisting of 6 numbers such as 405043 I need to somehow delete the first 3 numbers to have field just be 043 I could delete the first 3 numbers by hand but have 9600 records in table Thanks for any and all suggestions Ken
1
1600
by: Cryptographic_ICE | last post by:
Hello, I have a table that contains the name and location of backup tapes. The first Column has the tape ID (a four digit number) and the second column has a drop down box of possible locations such as "In Drive" or "In Storage". I also have a list of tape id's that were moved to storage. (the list is currently an access table) I would like to create a macro that would change the location column of the table to "In Storage". How could I...
1
2123
by: hgarcia | last post by:
Hi everybody, I need to modify the "execution path" in orther to instal a new library. How I can do this, actually I don't even know what an execution path is? Thanks, H
0
8466
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8896
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8810
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.