473,396 Members | 1,724 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.

ORACLE MIGRATION ISSUES


1. In the oracle trigger we have a SINGLE INSERT STORED PROCEDURE
CALLED MUTLIPLE TIMES with different values.

But when changed to DB2, it gives SQL -746 ?? Any help??
2. In oracle we have

Create or replace TYPE TEST_TYPE AS OBJECT ( ....,....)

Create or replace TYPE TEST_TABLE AS TABLE OF TEST_TYPE

This is used in a FUNCTION to return RESULT SET HAVING DATA AS IN A
TABLE AND this TABLE IS USED in JOINS in the application.

How do we do it in DB2??
3. Can a UDF call a STORED PROCEDURE OR TRIGGER in DB2?

Nov 12 '05 #1
3 1691
db*****@yahoo.com wrote:
1. In the oracle trigger we have a SINGLE INSERT STORED PROCEDURE
CALLED MUTLIPLE TIMES with different values.

But when changed to DB2, it gives SQL -746 ?? Any help?? Boy.. this is turning into a FAQ...
Can you send me the source by email? (I'll treat it with respect ;-)
I can take a quick peek.
2. In oracle we have

Create or replace TYPE TEST_TYPE AS OBJECT ( ....,....) CREATE TYPE employee_t AS (name varchar(10), id INTGER, ..)
Create or replace TYPE TEST_TABLE AS TABLE OF TEST_TYPE CREATE TABLE employee OF employee_t ....
This is used in a FUNCTION to return RESULT SET HAVING DATA AS IN A
TABLE AND this TABLE IS USED in JOINS in the application. Hah.... forget everything I wrote above.. you don't need it. The result
table is defined "on-the-fly":
CREATE FUNCTION table_foo(a INTEGER, b INTEGER)
RETURNS TABLE(c1 char(10), c2 char(10))
RETURN VALUES (char(a), char(b)),
(char(a + 1), char(b + 1));

SELECT * FROM TABLE(table_foo()) AS f;

(I didn't test that.. forgive me typos)
3. Can a UDF call a STORED PROCEDURE OR TRIGGER in DB2?

In DB2 V8.2 (which you have since you got the -746) you can call a
procedure from a UDF. You can not call a trigger directly (and I hope
Oracle is no different there), not from a UDF or anything.
Triggers "fire".

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
Serge Rielau wrote:
db*****@yahoo.com wrote:
1. In the oracle trigger we have a SINGLE INSERT STORED PROCEDURE
CALLED MUTLIPLE TIMES with different values.

But when changed to DB2, it gives SQL -746 ?? Any help??


Boy.. this is turning into a FAQ...
Can you send me the source by email? (I'll treat it with respect ;-)
I can take a quick peek.
2. In oracle we have

Create or replace TYPE TEST_TYPE AS OBJECT ( ....,....)


CREATE TYPE employee_t AS (name varchar(10), id INTGER, ..)

Create or replace TYPE TEST_TABLE AS TABLE OF TEST_TYPE


CREATE TABLE employee OF employee_t ....
This is used in a FUNCTION to return RESULT SET HAVING DATA AS IN A
TABLE AND this TABLE IS USED in JOINS in the application.


Hah.... forget everything I wrote above.. you don't need it. The result
table is defined "on-the-fly":
CREATE FUNCTION table_foo(a INTEGER, b INTEGER)
RETURNS TABLE(c1 char(10), c2 char(10))
RETURN VALUES (char(a), char(b)),
(char(a + 1), char(b + 1));

SELECT * FROM TABLE(table_foo()) AS f;

(I didn't test that.. forgive me typos)
3. Can a UDF call a STORED PROCEDURE OR TRIGGER in DB2?


In DB2 V8.2 (which you have since you got the -746) you can call a
procedure from a UDF. You can not call a trigger directly (and I hope
Oracle is no different there), not from a UDF or anything.
Triggers "fire".

Cheers
Serge


I am not aware of any RDBMS in which triggers are callable. Though what
one can do is put all of the trigger's code into a procedure and have
the trigger execute the proc.
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
Nov 12 '05 #3
Thanks Serge, I have sent you the code as requested

Nov 12 '05 #4

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

Similar topics

4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
1
by: ss_dash | last post by:
Hi all, I am using the Oracle Workbench for migrating my DB currently on Sql Server 2000 to Oracle 9i. During the migration the following happens SELECT @tBaseTable = tBaseTable,...
28
by: prunoki | last post by:
Hello, I am an SQL server newbie. Our company has a massive application written in PL/SQL. I need to port parts of it to SQL Server. - Which SQL server version should I choose, to have a...
4
by: Abram Friesen | last post by:
Hi, I'm a developer for a software application vendor, and our application makes use of a customer-maintained Oracle 8i/9i database. We've had a customer request to support DB2 database, and I'm...
8
by: Tavish Muldoon | last post by:
At a high level - what would be involved in switching from Oracle to DB2? Pretty vague, I know - but anyone have experience with this kind of migration? Pointers? Things to look for? Tmuld
2
by: Phil S | last post by:
I used the Migration Workbench for Oracle 9.2 Client to migrate the tables in an Access 2K back-end database to Oracle. (The Migration Workbench is intended to automate the process of migrating...
56
by: Ashish Patankar | last post by:
I want to migrate my Oracle 10g database to Db2. I want some documentation for the comparision between these to databases. I also want to know which features of Oracle 10g are supported by Db2 and...
2
by: manindra | last post by:
Recently we migrated our product from MS-SQL 2000 to Oracle 9i. We see lot of performance degradation due to migration. Some times complex queries are hitting 10 fold slower than SQL Server. ...
3
by: Girish | last post by:
Hi all, We are doing an exercise of migrating an application (developed in Informix 4gl) from Informix to Oracle database. Before doing actual migration, we would like to know some of the key...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
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
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.