![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, we are evaluating the possibility of migrating all of our Oracle databases to DB2 UDB, we need an easy way to migrate our procedures without rewriting all the codes. We are migrating Oracle to DB2UDB in Windows 2000. Our Oracle procedures reads a file one line at a time, treat the data, modify it and then insert it on a table or in another file. Then it reads the next line in the file, treats the data and so on... Oracle has a package named UTL_FILE that has several methods to tread files and permit us to read and write lines,one line at a time. Trying to migrate these procedures we downloaded the function os_calls UDF. The os_calls has two entries that allows reading from a file, but both of them reads the entire file and loads the data at a table or a clob. Is there a similar way in IBM DB2 to access files the way Oracle does that can help us to migrate our Oracle procedures that read files(one line at a time) with the minimum efforts? Thank You for your help, Valeria. |
#3
| |||
| |||
|
|
Hi, we are evaluating the possibility of migrating all of our Oracle databases to DB2 UDB, we need an easy way to migrate our procedures without rewriting all the codes. We are migrating Oracle to DB2UDB in Windows 2000. Our Oracle procedures reads a file one line at a time, treat the data, modify it and then insert it on a table or in another file. Then it reads the next line in the file, treats the data and so on... Oracle has a package named UTL_FILE that has several methods to tread files and permit us to read and write lines,one line at a time. Trying to migrate these procedures we downloaded the function os_calls UDF. The os_calls has two entries that allows reading from a file, but both of them reads the entire file and loads the data at a table or a clob. Is there a similar way in IBM DB2 to access files the way Oracle does that can help us to migrate our Oracle procedures that read files(one line at a time) with the minimum efforts? Thank You for your help, Valeria. |
#4
| |||
| |||
|
|
May I suggest you have a look at Object REXX? Object Rexx is a procedural language like Perl but much easier to learn. Reading/Writing lines and parsing the input is very easy with REXX. Database calls can be done by invoking the DB2 command line processor or via Rexx-DB2 API'S. |
#5
| |||
| |||
|
|
Valeria wrote: Hi, we are evaluating the possibility of migrating all of our Oracle databases to DB2 UDB, we need an easy way to migrate our procedures without rewriting all the codes. We are migrating Oracle to DB2UDB in Windows 2000. Our Oracle procedures reads a file one line at a time, treat the data, modify it and then insert it on a table or in another file. Then it reads the next line in the file, treats the data and so on... Oracle has a package named UTL_FILE that has several methods to tread files and permit us to read and write lines,one line at a time. Trying to migrate these procedures we downloaded the function os_calls UDF. The os_calls has two entries that allows reading from a file, but both of them reads the entire file and loads the data at a table or a clob. Is there a similar way in IBM DB2 to access files the way Oracle does that can help us to migrate our Oracle procedures that read files(one line at a time) with the minimum efforts? Thank You for your help, Valeria. I believe os_calls does have a table function that does read a piece of the file a time. Of course, you will have to modify it a bit. The nice thing about DB2 table udfs is that it can convert an entire file into a table like entity, treating each line as a row of data. You can do all kinds of query on it. The downside is it doesn't work very well on MPP system. What kind of file are you reading? Do you want just treat each line as a varchar string data? I can modify that function for you. |
#6
| |||
| |||
|
|
In article <3F81529B.7030804 (AT) nnll (DOT) iibbmm.com>, anton_versteeg (AT) nnll (DOT) iibbmm.com says... May I suggest you have a look at Object REXX? Object Rexx is a procedural language like Perl but much easier to learn. Reading/Writing lines and parsing the input is very easy with REXX. Database calls can be done by invoking the DB2 command line processor or via Rexx-DB2 API'S. I won't recommend the REXX-DB2 API's, their functionality is frozen since DB2 V5. Copied from the Information Center: Note the following points about software support: Fortran and REXX. DB2 will not enhance features for Fortran and REXX beyond the level of support for these languages in DB2 Universal Database Version 5.2. |
#7
| |||
| |||
|
|
I won't recommend the REXX-DB2 API's, their functionality is frozen since DB2 V5. Copied from the Information Center: Note the following points about software support: Fortran and REXX. DB2 will not enhance features for Fortran and REXX beyond the level of support for these languages in DB2 Universal Database Version 5.2. You could use rexx/sql (http://rexxsql.sourceforge.net/). Wolfgang |
![]() |
| Thread Tools | |
| Display Modes | |
| |