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 > Read from file one line at a time from DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-03, 13:49
valeria valeria is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
Question Read from file one line at a time from DB2

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.
Reply With Quote
  #2 (permalink)  
Old 10-03-03, 20:40
dlafreni dlafreni is offline
Registered User
 
Join Date: Jun 2003
Location: Canada
Posts: 35
Hi,

I don't known of any package in DB2 that would do this ...

One way that I have siimilar jobs is to load/import the data from an intermediate table that consists of two columns: a generated primary key and a varchar that is big enought to hold the largest ligne in the input file.

Once loaded in the table I used a stored procedure to process the data and insert its final table destination.

Hope can help ...

Dany


P.S. You might want to look at the IBM DB2 migration kit to Oracle:

http://www-3.ibm.com/software/data/db2/migration/mtk/
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