Select a file and load csv data into a table [message #447589] |
Tue, 16 March 2010 05:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Its_me_ved
Messages: 979 Registered: October 2009 Location: India
|
Senior Member |
|
|
Hi, I am new to oracle designer, forms. The requirement is to select a csv file in a form ,read the file and load selected columns from a csv file into a table.
I am using CLIENT_TEXT_IO. I want to know how to extract the data from selected columns from csv file and insert into a table if the lenth of the columns are of variable length.
Another condition is that if there are duplicate rows based on orderid then take the maximum order seq nbr.Do I need to use
temp table for this logic? Or there is any better approach?
[Updated on: Tue, 16 March 2010 05:03] Report message to a moderator
|
|
|
Re: Select a file and load csv data into a table [message #448734 is a reply to message #447589] |
Thu, 25 March 2010 01:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
As long as the length of the input data is less than or equal to the column width then just use an assignment.
Test whether you already have the 'orderid' in the database. If it exists then test whether the new 'order seq nbr' is greater than the one that exists in the stored record. If the new one is greated than delete the existing entry and insert the new one, if not then read the next 'csv' record.
David
|
|
|