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

Stored procedure question

From inside a stored procedure written in SQL PL, I need to insert a row in
a table in a different database which is in the same instance and on the
same server.

I have tried to use a federated connection and although I'm able to query
the table it does not allow me to insert anything in it. I get an sql30090
error with code 21.

I have seen a workaround which is a call to another stored procedure written
in C and which calls the DB2 CLP using the system function. I want to avoid
using C.

Does anyone have a better solution or idea?

Thanks,

J. Terrazas

Nov 12 '05 #1
3 2162
Juan Terrazas wrote:
From inside a stored procedure written in SQL PL, I need to insert a row
in a table in a different database which is in the same instance and on
the same server.

I have tried to use a federated connection and although I'm able to query
the table it does not allow me to insert anything in it. I get an sql30090
error with code 21.

I have seen a workaround which is a call to another stored procedure
written in C and which calls the DB2 CLP using the system function. I want
to avoid using C.

Does anyone have a better solution or idea?


What version of DB2 are you using?

Insert operations are supported with Version 8. So if you run on V8, it
might be a good idea to present some code that shows the failure.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
On 8/12/04 11:13 AM, in article cf**********@fsuj29.rz.uni-jena.de, "Knut
Stolze" <st****@de.ibm.com> wrote:
Juan Terrazas wrote:
From inside a stored procedure written in SQL PL, I need to insert a row
in a table in a different database which is in the same instance and on
the same server.

I have tried to use a federated connection and although I'm able to query
the table it does not allow me to insert anything in it. I get an sql30090
error with code 21.

I have seen a workaround which is a call to another stored procedure
written in C and which calls the DB2 CLP using the system function. I want
to avoid using C.

Does anyone have a better solution or idea?


What version of DB2 are you using?

Insert operations are supported with Version 8. So if you run on V8, it
might be a good idea to present some code that shows the failure.


Unfortunately I'm using v7.2

Nov 12 '05 #3
Juan Terrazas wrote:
On 8/12/04 11:13 AM, in article cf**********@fsuj29.rz.uni-jena.de, "Knut
Stolze" <st****@de.ibm.com> wrote:
Juan Terrazas wrote:
From inside a stored procedure written in SQL PL, I need to insert a row
in a table in a different database which is in the same instance and on
the same server.

I have tried to use a federated connection and although I'm able to
query the table it does not allow me to insert anything in it. I get an
sql30090 error with code 21.

I have seen a workaround which is a call to another stored procedure
written in C and which calls the DB2 CLP using the system function. I
want to avoid using C.

Does anyone have a better solution or idea?


What version of DB2 are you using?

Insert operations are supported with Version 8. So if you run on V8, it
might be a good idea to present some code that shows the failure.


Unfortunately I'm using v7.2


Support for INSERT/DELETE/UPDATE operations on nicknames was added for V8.
So I see the following options for you:

(1) move to V8
(2) write an external UDF (C or Java code comes to mind) that connects to
the other database and executes your SQL statement there - or it goes via
the "db2" clp route that you used.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

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

Similar topics

3
by: Ryan.Chowdhury | last post by:
This is a general question regarding the use of view and stored procedures. I'm fairly new to databases and SQL. I've created a SQL database using an Access Data Project ("ADP") and I'm...
1
by: Raquel | last post by:
Have a question on the Stored procedure method code generated by DB2 development center for Java stored procedures. Suppose I have a requirement to return the resultset consisting of FIRSTNME,...
8
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
5
by: Rhino | last post by:
This question relates to DB2 Version 6 on OS/390. Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file? I am trying to debug a stored procedure. As far...
5
by: Andy G | last post by:
I have a registration page that captures 75% of the users data. After they enter that info they are redirected to one of two pages depending on how they answered a question on the registation...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
11
by: peter | last post by:
I am trying to get a SQL stored procedure to use user maintained MQT implicitly which raises questions on when they are used or not used. In theory you would expect the stored procedure to pick up...
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
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?
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
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
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...
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.