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. '

Tags: Database

Similar Questions

  • 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. '

  • 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.

  • 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.

  • Please help me, I deleted a file by mistake.  How can I recover my account?

    Please help me to recover my file.  I was rearranging some docs in subfolders and deleted by mistake the main file, thinking the subfolders would always be there and they are all gone.  Lots and lots of docs.  PLEASE HELP ME!  The file was called "Cardis, jackets, Ponchos, and top models.  I was using the new Adobe Acrobat Reader software.

    I do not believe, you can if the only copy is on your iPad.

    You must perform backups of files you have on your mobile devices. Then restore from the backup. Backups could easily done by downloading them on cloud of Document, or a backup on another device.

  • Hi, I bought LR4 (MAC) as a student. I changed my MAC and now I forgot what account/email I use while buying LR4. Can you please help me download my LR4 for Mac thank you, Sabrina.

    Hi, I bought LR4 (MAC) as a student. I changed my MAC and now I forgot what account/email I use while buying LR4. Can you please help me download my LR4 for Mac thank you, Sabrina.

    You can download Lightroom 4 of

    http://www.Adobe.com/support/downloads/product.jsp?platform=Macintosh&product=113

    However, you will need to enter the serial number to activate the product

    If you are unable to locate the serial number and then contact adobe once customer

    http://helpx.Adobe.com/in/contact.html?step=LTRM-Photoshop-lightroom_membership-account-PA yment_payments-invoices-orders_stillNeedHelp

  • 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?

  • Please help - just downloaded Illustrator and it crashes after startup!

    Hi - I just download Ai and it doesn't work. I get this error message saying: Adobe Illustrator CC 2015 has stopped working and leaves the program.

    I tried to turn off the graphics card and that didn't work.

    But I'm not a technical person and I am very stuck.

    Can someone please help or advise?

    I use Windows on a Lenovo U330 Ultrabook 10.

    Thank you!

    Hi emilys1970,

    Thanks for posting this thread.

    Please share the file 'Illustrator.dmp' using the drop box or any other web site sharing.

    Follow these steps to create the dump file:

    Step 1: When I displays the dialog box message "Adobe Illustrator CC 2015 has stopped working" do not remove he

    Step 2: Launch 'Task Manager' and under 'Applications' tab right click on "Adobe Illustrator" to open the contextual pop-up menu

    Step 3: Select the option 'Create a Dump file' and wait for the process must be completed

    Step 4: once the end dialog box gets displayed click on the OK button to close the dialog box.

    Step 5: Press "Windows + r" to open the "Run" dialog OS WIN

    Step 6: Type "%temp%" in the edit field, press the Enter key

    Step 7: In the search for (Temp folder) window Explorer for files 'Illustrator.dmp' and share all of the sharing sites online help

    8: Please also shares details about the Version of Illustrator and OS WIN (64-bit or 32-bit) to [email protected]

    Thank you best regards &,.

    Rambour Singh

    Illustrator team

  • Please help with download. ?

    Please help with the download?

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • 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}

  • (Dell) Windows 7 Home Prem OA: Please HELP! Windows is loading files.

    To the right,.
    Since my brother was playing around with my computer and play Minecraft, I got a screen that says: "Windows loading files. I tried almost everything, and I'm desperate. I watched a lot of things that still doesn't work. Repeativly F8 at startup, F10, F12 and nothing. The thing is, whenever I have turn the computer back on, there is no commissioning. The screen will appear just by these words: "Windows is loading files," and a white bar at the bottom. I see no symbol start like HP or DELL. I see no screen connection. I tried unplugging and reconnecting TAB, CTR, ALT, DELETE, put highlighted with arrows keys and down and clicking on ENTER. EVERYTHING. He has also been disconnected from the internet for several months and I can't use the disc slot.

    I have also all my photos, songs, videos, work, life and data on this computer. I NEED A WAY TO REPAIR THIS COMPUTER WITHOUT LOSING ALL MY STUFF! Please, please, please help!
    Thank you!

    Since your computer laptop is a Dell, I highly recommend going to Dell Community support.

    It's the HP product HP consumer support forum.

    http://en.community.Dell.com/support-forums/

  • Please help to download illustrator CS6

    Please help me to download illustrator CS6

    can someone HELP me

  • 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

  • Please help me PROTECT my data files (both in Vista and outlook). (Thank you)

    Team,

    I just spent HOURS trying to this issue, including the chat with HP (useless) search.  Help, please!  (Thanks! 0)

    I'm the only account on my computer, but I have the children/woman/woman of household living with me.  When I connect to my computer at startup, I log in as one user, who IS the administrator... all the same person, me.  Once connected, I can access all my folders, files, and Outlook.  I want to add ANOTHER layer of security to CERTAIN folders of Windows and SOME folders in Outlook.

    I don't want to NOT create new accounts users, etc. as which will not help to solve the problem, I am trying to solve - which is, when I am connected and working, but not away from my computer to answer the door or go to the toilet or to take a phone call - anyone, I don't want passerby (household/child/woman woman) to be able to sit and to access all folders in Windows or some of the folders in Outlook.

    On the contrary, I want to create a secure repository or a 'safe' on my desk where I store some personal records.  Ditto, when outlook is OPEN AND running on my computer already connected, I want to enter a password EVERY time I try and open my 'sent' folder or my 'personal '.

    I tried the whole 'click on the folder' and go to 'Properties' and then select 'Security' and change allow it to deny... but it does not work BECAUSE I AM THE ONLY USER = I am the ADMINISTRATOR.  If I simply create other accounts, that does not solve the problem b/c I still want access to these special folders WHEN I'M LOGGED in I am trying to add a 2nd password or layer of security for ME EVEN when I am logged in, once again, simply to prevent a person from going back up to my computer when I am already connected and able to see everything on my computer or in my outlook.

    Regarding the Outlook, I went and highlighted my personal files and went to the management of the data and settings and added a password, but I think that just put a password on the actual .pst file on the computer, b/c even after I did it and I opened Outlook I could go in any folder I want without having to add the word of past.

    I'm not married to this solution, so if anyone knows a better way to protect my sensitive files on my computer AFTER I've already logged in as me... and walk for a minute or an hour (which may never know how long something will take), I would be grateful.  And Yes, I'm trying to remember to hit 'sleep' whenever my foot, but sometimes I forget and I want just a second layer/password when I am already connected.

    Thank you!!!

    answered in another thread

    http://social.answers.Microsoft.com/forums/en-us/vistasecurity/thread/a22bba48-3b5a-4EB2-b1b7-b8178a5ef103/

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

Maybe you are looking for