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? 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
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)
Thanks Serge, I have sent you the code as requested This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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
|
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,...
|
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...
|
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...
|
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
|
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...
|
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...
|
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.
...
|
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...
|
by: --CELKO-- |
last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any
kind of tools for this?
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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,...
| |