If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > help reg usage of procedure ouput in insert statement during process of oracle to db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-07, 11:11
sumanonlineprem sumanonlineprem is offline
Registered User
 
Join Date: Oct 2007
Posts: 1
help reg usage of procedure ouput in insert statement during process of oracle to db2

I am migrating our application from oracle8i to db2 v9.1, during this process all our udf oracle functions are now chaged as procedures in db2.

As oracle allows function calls in dml statements as following:

INSERT INTO TestTable(RECORDID, FIELDID, UnitsID) VALUES ( 307, 12,Masters.getUnitsID('Nos'));

here Masters.getUnitsID('Nos') is a funtion in Masters package which returns integer id.

During migration 'Masters.getUnitsID('Nos'))' is changed as procedure with name getUnitsID('Nos', ret_val) in Masters schema.

now i want to convert above oracle insert statement to db2.

Please suggest the possible ways those can be used to get that functionality.

Thanks in advace
Reply With Quote
  #2 (permalink)  
Old 10-02-07, 13:37
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You can either use a tool that properly converts functions to functions, rewrite the functions on DB2 (which is ultimatively the best solution in most cases), or you wrap a function around the generated procedure.

Why were those functions changed to procedures? Which tool did you use for that?

I'm asking because the solution is to use UDFs (user-defined functions) in DB2 as well. For example, create a function "getUnitsID" in schema MASTERS and you will not have to change anything in your INSERT statement.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On