Download of CSV files

Hello
I am trying to load the custom table CSV data

I get the error on the next line

fileName = (String) fileUploadData.selectValue (null, "UPLOAD_FILE_NAME");

error is:

"Error (69,41): selectValue (null, java.lang.String) method" can't find is not in the oracle.cabo.share.data.DataObject interface ".

The code used is as follows:


' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
{
super.processFormRequest (pageContext, webBean);
OAApplicationModule m = pageContext.getApplicationModule (webBean) (OAApplicationModule);
OAViewObjectImpl vo = am.findViewObject("xxuploadsVO") (OAViewObjectImpl);
If ("Go".equals (pageContext.getParameter (EVENT_PARAM)))
{
DataObject fileUploadData (DataObject) = pageContext.getNamedDataObject ("FileUploadItem");
String fileName = null;
String contentType = null;
Long fileSize = null;
Integer fileType = new Integer (6);
BlobDomain uploadedByteStream = null;
BufferedReader in = null;
Try
{
fileName = (String) fileUploadData.selectValue (null, "UPLOAD_FILE_NAME");
contentType = (String) fileUploadData.selectValue (null, "UPLOAD_FILE_MIME_TYPE");
uploadedByteStream = (BlobDomain) fileUploadData.selectValue (null, fileName);
in = new BufferedReader (new InputStreamReader (uploadedByteStream.getBinaryStream ()));
file = new Long size (uploadedByteStream.getLength ());
System.out.println ("FileSize" + FileSize);
}
catch (NullPointerException ex)
{
throw new OAException ("Please select a file to download", OAException.ERROR);
}
try {}
Open the CSV file for reading
String lineReader ="";
t length = 0;
String linetext [];

While (((lineReader = in.readLine ())! = null)) {}
Split delimited data and
If (lineReader.trim () .length () > 0)
{
System.out.println ("lineReader" + lineReader.length ());
LineText = lineReader.split(",");
t ++ ;
Print the current line current
System.out.println (t + "-" +)
LineText [0]. Trim() + "-" + linetext [1] .trim () + ' - ' +.
LineText [2]. Trim() + "-" + linetext [3] .trim () + ' - ' +.
LineText [4]. Trim() + "-" + linetext [5] .trim ());
If (! vo.isPreparedForExecution ()) {}
vo.setMaxFetchSize (0);
vo.executeQuery ();
}
Line = vo.createRow ();
row.setAttribute ("Attribute1", linetext [0] .trim () ");
row.setAttribute ("Attribute2", linetext [1] .trim ());
row.setAttribute ("Attribute3", linetext [2] .trim ());
row.setAttribute ("Attribute4", linetext [3] .trim ());
VO. Last();
VO. Next();
vo.insertRow (row);
}
}


If ("Upload_table".equals (pageContext.getParameter (EVENT_PARAM)))
{
null;
}
}
catch (IOException e)
{
throw new OAException (e.getMessage (OAException.ERROR));
(e.getMessage (OAException.ERROR));

}
}
ElseIf (Upload".equals (pageContext.getParameter (EVENT_PARAM))) {" "}
am.getTransaction () .commit ();
throw new OAException ("Uploaded SuccessFully", OAException.CONFIRMATION);

}
}

Please suggest some guidelines...

Maybe by posting in the appropriate forum {forum: id = 210}

Tags: Java

Similar Questions

  • Publish everything by downloading a CSV file in a form

    We have a master (M) and detail (D) registration form. The main block and can display 5 files at once (multi block)

    The recordings will be filled by downloading a CSV file from the hard drive.

    Question

    If there are 5 records in the csv file, the download works correctly. If this isn't the case, it won't be very good.

    We were wondering if there is a few BLOCKS / WEB of property should be defined, which will allow more than 5 documents to download

    Please provide your valuable suggestions

    Thank you

    "Error in the filling of the block" isn't an oracle error message. When the error appears, like her "FRM - 12345 Text". Please post the 3 initial letters and the number 5-digits of the error. Also you said nothing about your version of forms or code that you use to fill the block.

  • How to download the Csv file with column headers

    Hi all

    This is pavan, using Apex version 4.2.3


    I am trying to download the csv file I followed this link , and I'm able to download excel with headers, when I try to download with headers of this error "'ORA-01858: a non-digit character was found here where was waiting for a digital" I searched in google but could not find the right solution, "


    can anyone help on this please.

    Thanks in advance,


    Kind regards

    Pavan

    This article is 6 years old.

    You should study the solutions that are available for APEX 4.2: data loader or the 'Excel2Collection' plugin (which also manages the CSV files).

    Data Loader

    It is a wizard that generates an Assistant for your application.

    Excel2Collection

    You will use the Excel2Collection (in a single process) to convert the BLOB in a Collection

    Then, in a 2nd address), you just do a "INSERT...". SELECT statement.  Add ' where seq_id > 1 "for files with a header.

    MK

    PS - Use the "EXECUTE IMMEDIATE" article is not necessary.

  • need help on download of CSV files

    Hi all

    I need to download a csv file in the table through browse file button. To do this, I created the process and function below. This method works perfectly fine when the file size is small. But I need to download the file size of 16 MB and when I try to download this file it give error wwv_flow.accept. Any expert from the TOP please help me about this error. As I am very new to the APEX, and I need to achieve this as soon as possible. Please provide any solution, I will be really grateful to the person.

    function

    create or replace function hex_to_decimal
    -This function is based on one by Connor McDonald
    -http://www.jlcomp.demon.co.uk/faq/base_convert.html
    (P_hex_str in varchar2) return number
    is
    number of v_dec;
    v_hex varchar2 (16): = '0123456789ABCDEF ';
    Start
    v_dec: = 0;
    for indx in 1... Length (p_hex_str)
    loop
    v_dec: = v_dec * 16 + instr (v_hex, upper (substr(p_hex_str,indx,1)))-1;
    end loop;
    Return v_dec;
    end hex_to_decimal;


    Process of

    DECLARE
    v_blob_data BLOB;
    v_blob_len NUMBER;
    V_POSITION NUMBER;
    v_clob_data CLOB: = 'nothing. '
    dest_offset NUMBER: = 1;
    offset NUMBER: = 1;
    blob_csid NUMBER: = dbms_lob.default_csid;
    lang_ctx INTEGER: = dbms_lob.default_lang_ctx;
    caveat INTEGER;



    v_raw_chunk RAW (10000);
    v_char char (1);
    number of c_chunk_len: = 1;
    v_line VARCHAR2 (32767): = NULL;
    v_data_array wwv_flow_global.vc_arr2;
    number of v_rows;
    number of v_sr_no: = 1;


    BEGIN


    delete from scg_recievables2;


    -Read data from wwv_flow_files
    Select blob_content from v_blob_data
    of wwv_flow_files
    where last_updated = (select max (last_updated) in the wwv_flow_files where UPDATED_BY =: APP_USER)
    and id = (select max (id) in the wwv_flow_files where updated_by =: APP_USER);



    v_blob_len: = dbms_lob.getlength (v_blob_data);
    V_POSITION: = 1;


    -Read and convert binary to a char
    WHILE (v_position < = v_blob_len) LOOP
    DBMS_LOB.converttoclob (v_clob_data, v_blob_data, v_blob_len, dest_offset, offset, blob_csid, lang_ctx, warning);
    v_char: = dbms_lob.getlength (v_clob_data);


    v_line: = v_line | v_char;
    V_POSITION: = v_position + c_chunk_len;
    -When a whole line is retrieved < / span >
    IF v_char = Chr (10) THEN
    -Convert comma to: use of wwv_flow_utilities
    v_line: = REPLACE (v_line, ';', ' :');)
    -Converting each column separated by: in the data table
    v_data_array: = wwv_flow_utilities.string_to_table (v_line);
    If IsNumber (substr (v_data_array (9), 1, 1)) = 1 then
    v_data_array (9): = substr (v_data_array (9), 1, 11);
    on the other
    v_data_array (9): = January 1, 1900 ";
    end if;
    v_data_array (9): = NVL (v_data_array (9),'' 01-JAN-1900);
    -Insert data into the target table
    EXECUTE IMMEDIATE ' insert into scg_recievables2 (Account_receivable_number, the_account_number, bill_history_tran, service_number, item_type, the_amount_billed, the_remaining_amount, source_of_payment)


    values (: 1,: 2:3:4: 5: 6: 7: 8,:' 9)
    USING
    v_data_array (1),
    v_data_array (2),
    v_data_array (3),
    v_data_array (4),
    v_data_array (5),
    v_data_array (6),
    v_data_array (7),
    v_data_array (8);
    -Remove
    v_line: = NULL;
    v_sr_no: = v_sr_no + 1;
    END IF;


    END LOOP;
    END;

    You're probably delay with your web server. Check the server logs to see if there are errors...

    Thank you

    Tony Miller
    Webster, TX

    A lady came up to me on the street, pointed at my suede jacket and said: "do you not know that a cow was murdered for that jacket?
    ' I didn't know there are witnesses ', I replied: "now, I'll have to kill you too. '

  • Please help to download a CSV file on APEX by browsing file

    Hi all

    I need to download a csv file in the table through browse file button. To do this, I created the process and function below. This method works perfectly fine when the file size is small. But I need to download the file size of 16 MB and when I try to download this file it give error wwv_flow.accept. Any expert from the TOP please help me about this error. As I am very new to the APEX, and I need to achieve this as soon as possible. Please provide any solution, I will be really grateful to the person.


    _ Function

    create or replace function hex_to_decimal
    -This function is based on one by Connor McDonald
    -http://www.jlcomp.demon.co.uk/faq/base_convert.html
    (P_hex_str in varchar2) return number
    is
    number of v_dec;
    v_hex varchar2 (16): = '0123456789ABCDEF ';
    Start
    v_dec: = 0;
    for indx in 1... Length (p_hex_str)
    loop
    v_dec: = v_dec * 16 + instr (v_hex, upper (substr(p_hex_str,indx,1)))-1;
    end loop;
    Return v_dec;
    end hex_to_decimal;


    _ Process

    DECLARE
    v_blob_data BLOB;
    v_blob_len NUMBER;
    V_POSITION NUMBER;
    v_clob_data CLOB: = 'nothing. '
    dest_offset NUMBER: = 1;
    offset NUMBER: = 1;
    blob_csid NUMBER: = dbms_lob.default_csid;
    lang_ctx INTEGER: = dbms_lob.default_lang_ctx;
    caveat INTEGER;



    v_raw_chunk RAW (10000);
    v_char char (1);
    number of c_chunk_len: = 1;
    v_line VARCHAR2 (32767): = NULL;
    v_data_array wwv_flow_global.vc_arr2;
    number of v_rows;
    number of v_sr_no: = 1;

    BEGIN

    delete from scg_recievables2;

    -Read data from wwv_flow_files </span >
    Select blob_content from v_blob_data
    of wwv_flow_files
    where last_updated = (select max (last_updated) in the wwv_flow_files where UPDATED_BY =: APP_USER)
    and id = (select max (id) in the wwv_flow_files where updated_by =: APP_USER);


    v_blob_len: = dbms_lob.getlength (v_blob_data);
    V_POSITION: = 1;

    -Read and convert the binary for char </span >
    WHILE (v_position < = v_blob_len) LOOP
    DBMS_LOB.converttoclob (v_clob_data, v_blob_data, v_blob_len, dest_offset, offset, blob_csid, lang_ctx, warning);
    v_char: = dbms_lob.getlength (v_clob_data);

    v_line: = v_line | v_char;
    V_POSITION: = v_position + c_chunk_len;
    -When a whole line is retrieved < / span >
    IF v_char = Chr (10) THEN
    -Convert comma to: to use wwv_flow_utilities </span >
    v_line: = REPLACE (v_line, ';', ' :');)
    -Converting each column separated by: in the data table </span >
    v_data_array: = wwv_flow_utilities.string_to_table (v_line);
    If IsNumber (substr (v_data_array (9), 1, 1)) = 1 then
    v_data_array (9): = substr (v_data_array (9), 1, 11);
    on the other
    v_data_array (9): = January 1, 1900 ";
    end if;
    v_data_array (9): = NVL (v_data_array (9),'' 01-JAN-1900);
    -Insert data into the table target </span >
    EXECUTE IMMEDIATE ' insert into scg_recievables2 (Account_receivable_number, the_account_number, bill_history_tran, service_number, item_type, the_amount_billed, the_remaining_amount, source_of_payment)

    values (: 1,: 2:3:4: 5: 6: 7: 8,:' 9)
    USING
    v_data_array (1),
    v_data_array (2),
    v_data_array (3),
    v_data_array (4),
    v_data_array (5),
    v_data_array (6),
    v_data_array (7),
    v_data_array (8);
    -Remove
    v_line: = NULL;
    v_sr_no: = v_sr_no + 1;
    END IF;

    END LOOP;
    END;

    As mentioned, this disrupts the question, because a possible answer was published in the OTHER thread... Check your server logs, you probably delay... Preliminary discussions with a similar problem:

    Take a look at the httpd.conf file (or get your system administrator to look at it) and see what's on the value of TimeOut. You may need to increase in order to export large tables by APEX.

    http://www.apacheref.com/ref/http_core/timeout.html

    Thank you

    Tony Miller
    Webster, TX

    A lady came up to me on the street, pointed at my suede jacket and said: "do you not know that a cow was murdered for that jacket?
    ' I didn't know there are witnesses ', I replied: "now, I'll have to kill you too. '

  • ADF: How to manage the value zero when downloading the csv file

    Dear all,

    I'm new in the ADF and use 12.2.1. I am downloading of data in the database using af table: inputfile and CSVParser class. Data download correctly in the database where all columns are met, but whenever the csv file has value null (empty) in his column, then CSVParser class does not recognize it and get the next value of columns and assign the previous column. I also tried another one that uses a different class to download date but not get success.

    For Ex:

    ID name Dept

    1 abc Dept1

    2 cde Dept2

    3 Dept3

    In example above two first line are perfectly inserted in the table while the third line Id goes to ID column, due to the value of the column name is null class CSVParser does not recognize it and put Dept3 in the name column.

    Please help how to handle this.

    Thanks in advance.

    Kind regards

    Hello

    Try with this

    UploadedFile file = (UploadedFile)valueChangeEvent.getNewValue();
    InputStream is = null;
    BufferedReader br = null;
    try {
        is = file.getInputStream();
        br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        String line = "";
        while ((line = br.readLine()) != null) {
             String[] csvCols = line.split(",");
             // do somethinig smart with csvCols
        }
    }finally{
        if (br != null) try{br.close();}catch(Exception ex){br = null;}
        if (is != null) try {is.close();} catch(Exception exxx){is = null;}
    }
    
  • Download the .csv file display output white

    Hi all

    We are facing problem when we try to download the output from one page to the .csv format or any other format. After downloading, we not get any data in .csv file.

    Action - Download-> .csv file displays only not all data

    Please help me how to solve this problem.

    Kind regards

    Sushant

    What is the relevant SQL? Do you have any bind variables? They are included in session state?

  • Performance problem when downloading the CSV files into Oracle tables

    We have implemented the Vikas solution ([http://htmldb.oracle.com/pls/otn/f?p=38131:1]) to download CSV files into tables Oracle permanent and it works fine. However, whenever we try to send more than 5,000 records, it takes a lot of time and often wait times. What can we do to improve performance? We are running HTMLDB 2.0.

    For example, a CSV file with 12000 documents and 40 columns takes 40 minutes to load (while a recording of CSV 2000 file takes 2 minutes to load).

    For large external files, copy us our CSV files to the Oracle server and then make reference to the file in an Oracle external table. Once the external table defined you then load your APEX table via a stored procedure by using:

    INSERT INTO your_tbl (columns)
    SELECT (columns)
    Of external_tbl

    Hope that gives you another option to consider.

    Jeff

  • CSV file and download by programming?

    Hello

    A seller is made available for me to download a csv file but from now on, I'm going to a URL with an .aspx or .php extension (do not remember) and he invites me to save the csv file, then open it etc.  Is it possible to generate scripts somehow this output?  Is there a way to open the CSV somehow or add script so it gets downloaded somewhere, then open it programmatically?  I'm not hittin the csv file directly, but unfortunately, it is just like that.

    There is a php page or an aspx page that generates this csv if I get the file download area when I do it through my browser, but I want to sort out the data programmatically.


    I use CF9.

    -Westside

    You can download the file on your server with cfhttp.

    What do you mean by "open"?

  • cannot paste copied from CSV files online entered into the Excel worksheet (chatted with Cedric_L on 03/05/10 at approximately 2.30 CST but I got disconnected. not got an answer...)

    Here is the transcript of a chat with Firefox community member zzxcon may 3/10

    Now you are chatting with Firefox community member Cedric_L
    Cedric_L: Hello
    Cedric_L: what happens when you try to download a .csv file?
    Seegal: Hello
    Seegal: it is not copy
    Cedric_L: how you try to copy?
    Seegal: pls bear with me, I'm a slow typist. Just copy the selected text
    Biolizard joined the conversation.
    Cedric_L: ok - you choose what text?
    Seegal: I reconcile my checkbook (worksheet in this way). I copy my bank acc online items and paste it in the worksheet
    Seegal: I use Firefox 2.0.0.19. Have no problem to do so.
    Cedric_L: what version of Mac OS X?
    Seegal: in the new version nothing happens when trying to paste - just doesn't add up
    Cedric_L: Firefox 2.0.0.x is no longer supported and has not been supported by more than a year
    Cedric_L: paste into Excel from Firefox?
    Seegal: Sorry, I'm early... 2.0.0.19
    Seegal: Yes. I opened my bank acc in Firefox
    Cedric_L: what version of Excel?
    Cedric_L: it would really help if you could tell me step by step what you do.
    Seegal: first re: your previous question: is OS 10.4.11
    Seegal: on Excell: it' ACE 2004 version - the lasat one product for Macs. The specific version is 11.3.7
    Seegal: so I opened my ACC. to bank online in Firfox (my main browser). I copy the last entry in the account and paste in my Excel spreadsheet.
    Cedric_L: so, you copy directly from the web page without having to download a CSV file?
    Seegal: what do you mean by CSV file download? I could export to the https://chat-support.mozilla.com:9091/webchat/getimage? image = sendmessage & workgroup=support%40workgroup.chat-support.mozilla.comFirefox to the CSV file, but the other way around?
    Cedric_L: you copy your bank statement directly from the web site to Excel by using the Clipboard?
    Seegal: so do not use the Clipboard. It is a mac. There is no need to do so. In the PC, it would be Yes.
    Cedric_L: I need to know the exact steps that you deliver to bring in excel
    Cedric_L: and I need to know what exactly goes wrong in the latest version of Firefox.
    Seegal: you have a mac it with Firefox and Excel? It is very easy to reproduce. Imagine you open access to online banking, select a few entries, click on 'copy', to make your already open Excel worksheet and click "Paste". That's all!
    Cedric_L: when this happens, do you have cryptic code pasted into Excel?
    Seegal: as I said before: in all newer versions starting with 3.0 when I go to Excel to 'stick' of my bank acc, nothing happens. It does not stick. No, I don't get a cryptic code pasted, just NOTHING.

    Cedric_L: what happens if you paste into MS Word instead?
    Seegal: haven't tried, most likely the formatting would be lost. Tried with an another el Exc spreadsheet-it lost all the formatting and pasted as continuous text.

    This has happened

    Each time Firefox opened

    Is copy of the cat above. THIS MAC OS X. In the older versions before 3.0 I could copy the CSV file on the site Web Ibank VAC) and paste it directly to my spreadheet Excel reconciling my account.

    There is a known issue with Mac Office versions prior to 2007 version that results in release of Clipboard does not correctly supported. Firefox 3.0, being a more recent application, using the new format for the HTML Clipboard data. Unfortunately, Office 2004 and Office X do not support this.

    If you upgrade to MS Office 2007, it should work as expected.

  • BlackBerry Smartphones csv file of the computer laptop portable Torch and sync and agendas of torch

    It is without doubt 'old hat' to the BB community out there but how do I download a csv file (from my contacts) from my laptop to my lamp?

    Also how to sync my laptop and the calendars of the torch?

    I need to download Blackberry desktop manager on my laptop first BB site?

    TA.

    Neil

    neiljbruce wrote:

    I need to download Blackberry desktop manager on my laptop first BB site?

    Absolutely Yes.

    V.6 BlackBerry Desktop Software download here:
    https://www.BlackBerry.com/downloads/entry.do?code=A8BAA56554F96369AB93E4F3BB068C22

    For your CSV file: KB11194 how to import contacts from a CSV file already created for the BlackBerry smartphone

    Once you install the Desktop software, you will see the options for the synchronization of the organiser, who set up and you will be fine... depending on what software the calendar on your laptop computer is located.

  • How to download the CSV from Server?

    Hello

    We have an obligation where the user must download a (.csv) file from the server by clicking a button in the OPS.

    Thank you

    Palacin

    Please see the update below of Oracle Technology Mukul Blog: download option giving the user of a file at a particular location on the application server

    ============================

    When you run this code in jdeveloper, jdev has its own local as application server OC4J server, so your local machine acts as a server and the way that you MENTION it, it will search in the path to your local office itself, that's why you get this error, since this file and the path that you MENTION is there on the server of real applications Oracle apps and not on your local desktop.

    Therefore, once you deploy this code on the server and run try to access this page from there, it works perfectly.

    =============================

    You must run after you deploy the code on the server.

    -Coco

  • Hide / show column for download in CSV format

    Interactive report how to include a hidden column of the report for download file (CSV).

    For example, if I have the 'Note' field, which is hidden in the IR, but what happens if I need this field to downloaded. CSV file.

    Thank you

    Copied OK delete now

  • Import a CSV file into a table

    Hello

    I followed this example to download the CSV file in table in the database.
    http://avdeo.com/2008/05/21/uploading-Excel-sheet-using-Oracle-Application-Express-apex/

    It seems that no file is saved in this table - wwv_flow_files

    When I run the procedure laid down in the above example, I get error "No data found".
    Please, help me.

    I use Oracle Apex version 4.0.2

    Thank you!

    See my sample application

    http://Apex.Oracle.com/pls/Apex/f?p=51467:1:3854972221692354:no:

    user: test password: test

  • CSV file upload to database page-Urgent OFA

    Hi all

    How to download the CSV file of the database using the OFA page


    Thanks and greetings

    Please see a need to download a CSV/Excel to a table on the page of the OFA

    Kind regards
    Out Sharma

Maybe you are looking for