Uploading a csv file through XDB FTP

Hello
I'm developing a project where i need to upload a big amount of data, contained in a CSV file, on the file system of a database server and it would be great if the FTP service provided with XDB could be used to achieve such a job.
Does somebody know if XDB-FTP is able to upload files outside the XML repository and to upload them directly ( without intermediate steps that may generate heavy redo-log generation ) into a file-system on the database server?
I'd like to consider other good alternatives too, now I'm using a different FTP server but I would like to avoid this dependency.
Thanks
Bye Alessandro

I finally solved the problem using a Java class that launches a daemon listening for an incoming connection, that stores the first stream on a text file and then terminates.
Definition of the java class
create or replace and compile java source named SimpleFileTransfer as
import java.net.*;
import java.io.*;
class SimpleFileTransfer {
     private int port;
     private int timeout;
     private ServerSocket serverSocket;
     private int buffSize = 8192;
     private String savingFilePath;
     public SimpleFileTransfer( int port, int timeout, String fname) throws IOException,SocketException {
          this.port = port;
          this.timeout = timeout;
          this.savingFilePath = fname;
          serverSocket = new ServerSocket(port);
          serverSocket.setSoTimeout(timeout);
     public void prepareToReceive() {
          System.out.println("Preparing to receive "+savingFilePath+" on port "+port);
          (new FileWriter()).start();
          //System.out.println("Prepared to receive");
     class FileWriter extends Thread {
          Socket socket;
          BufferedReader in;
          PrintWriter out;
          public void run() {
               //System.out.println("Server started");
               try {
                    socket = serverSocket.accept();
                    //System.out.println("Ready to receive");
                    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                    out = new PrintWriter(savingFilePath);
                    char arr[] = new char[buffSize];
                    int readBytes;
                    while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
                         //System.out.println("Receive data starting with "+arr[0]);
                         out.write(arr,0,readBytes);
                         out.flush();
                    in.close();
                    out.close();
               catch (IOException e) {
                    e.printStackTrace();
               //System.out.println("Terminated");
     public static void activateService(int port,int timeout,String savingFilePath) /*throws SocketException, IOException*/ {
          try {
               SimpleFileTransfer ft = new SimpleFileTransfer(port,timeout,savingFilePath);
               ft.prepareToReceive();     
          catch (IOException e) {
               e.printStackTrace();
     public static void main(String args[]) throws IOException {
          int myPort = 21000;
          if (args[0].equals("server")) {
               activateService(myPort,10000,"C:\\\\D.dat");
          else (args[0].equals("client")) {
               Socket s = new Socket("database_host",myPort);
               BufferedReader in = new BufferedReader(new FileReader("D:\\\\D.dat"));
               PrintWriter out = new PrintWriter(s.getOutputStream());
               int readBytes;
               int buffSize = 8192;
               char arr[] = new char[buffSize];
               while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
                    //System.out.println("Send data starting with "+arr[0]);
                    out.write(arr,0,readBytes);
                    out.flush();
               in.close();
               out.close();
}Definition of PL/SQL wrapping procedure to activate the daemon on the database
create or replace
procedure ENABLE_TRANSFER (
          port in number,
          millis_timeout in number,
          saving_incoming_path varchar2
     ) is
language java
name 'SimpleFileTransfer.activateService(int,int,java.lang.String)';Activation of the daemon
begin
     enable_transfer(21000,10000,'C:\temp\incoming.txt');
end;Sample call to the main method of the class to work as client for uploading.
prompt> java SimpleFileTransfer clientBye Alessandro

Similar Messages

  • Please help on uploading a CSV file on APEX through file browse

    Hi All,
    I need to upload a csv file in the table through file browse button.For that i have created the below process and function.This method is working perfectly fine when the file size is small.But i need to upload the file of 16 MB size and when i try to upload that file it gives error wwv_flow.accept error.Any expert of APEX please help me out on this error.As i am very new to APEX and i need to get this done as early 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
    v_dec number;
    v_hex varchar2(16) := '0123456789ABCDEF';
    begin
    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 := 'anything';
    dest_offset NUMBER := 1;
    src_offset NUMBER := 1;
    blob_csid NUMBER := dbms_lob.default_csid;
    lang_ctx INTEGER := dbms_lob.default_lang_ctx;
    warning INTEGER;
         v_raw_chunk RAW(10000);
         v_char CHAR(1);
         c_chunk_len number := 1;
         v_line VARCHAR2 (32767) := NULL;
         v_data_array wwv_flow_global.vc_arr2;
         v_rows number;
         v_sr_no number := 1;
         BEGIN
         delete from scg_recievables2;
         -- Read data from wwv_flow_files</span>
         select blob_content into v_blob_data
         from wwv_flow_files
         where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER)
         and id = (select max(id) from 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 char</span>
         WHILE ( v_position <= v_blob_len ) LOOP
         dbms_lob.converttoclob(v_clob_data, v_blob_data, v_blob_len, dest_offset,src_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, ';', ':');
         -- Convert each column separated by : into array of data </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);
    else
    v_data_array(9) := '01-JAN-1900';
    end if;
    v_data_array(9) := NVL(v_data_array(9),'01-JAN-1900');
         -- Insert data into target table </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);
         -- Clear out
         v_line := NULL;
         v_sr_no := v_sr_no + 1;
         END IF;
         END LOOP;
         END;

    As noted, this confuses the issue, since a possible answer was posted in the OTHER thread.. Check your server logs, you are probably timing out.. From prior threads with a similar issue:
    Have a look at the httpd.conf file (or get your system administrator to look at it) and see what the value of TimeOut is set to. You may need to increase it in order to export large tables via 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 know a cow was murdered to make that jacket?"
    "I didn't know there were any witnesses", I replied " Now I'll have to kill you too"

  • VISA: How to get the CSV file through C/C++ code?

    How to get the CSV file through C/C++ code?
    I'm communicating with a USB oscilloscope using VISA.

    Thank you for your reply.
    I am using Apache Commons File Upload. Here is the code where I got the "fi".
         DiskFileUpload fu = new DiskFileUpload();
              fu.setSizeMax(1000000000);
              List fileItems = fu.parseRequest(request);
             Iterator itr = fileItems.iterator();
              FileItem fi = (FileItem)itr.next();
              if(!fi.isFormField())
                File tempFileRef  = new File(fi.getName());
         System.out.println("Field = "+tempFileRef.getAbsolutePath());
         }

  • Uploading a CSV file and getting Error ORA-01403: no data found in V4.1.1.

    I have an issue where myself and another user are unable to upload a csv file to my application using the "File Browse" page item in V4.1.1. I get the following error, "Error ORA-01403: no data found".
    This function was working perfectly last week prior to the upgrade of our APEX to V4.1.1 from V3. Other users are still able to upload the csv file, so the PL/SQL behind it must be ok.
    So here is where I am up to with testing.
    Tested the upload using my login on my PC – Fail
    Tested the upload using my login on another PC – Fail
    Tested the upload using other user’s login on my PC – Success
    Tested the upload using other user’s login on another PC - Success
    Any help would be greatly appreciated.
    Cheers,
    Greg

    The offending piece of code was in a block of script that I used from an online sample when I was first setting up this upload script. A colleague had the same issue in another application and rewrote the script to resolve the issue, see below.
    I'm still perplexed as to why the majority of users could run it ok, and there were only 2 of us that it errored on. But now it's working for all, and I can go back to building some cool stuff in V4.1.1.00.23.
    -- Read data from wwv_flow_files
    select blob_content into v_blob_data
    from wwv_flow_files
    where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USERID)
    and id = (select max(id) from wwv_flow_files where updated_by = :APP_USERID);
    -- Rewritten to the following, which works.
    select blob_content into v_blob_data
    from wwv_flow_files
    where id = (select ID from wwv_flow_files
    where UPDATED_BY = :APP_USERID
    and LAST_UPDATED = (select max(LAST_UPDATED) from wwv_flow_files where UPDATED_BY = :APP_USERID));

  • Uploading a CSV file

    When I try to upload a CSV file in my program it gives me an error message - Do not have an E-mail address column even though I do have an E-mail column and a list of E-mail addresses. How can I resolve this problem?

    What email program are you using? I sent a .csv file via Mail, it worked perfectly.

  • Can we create .CSV files through documaker

    Hi,
    Is it possible to create .csv files through documaker apart from pdf's
    Thanks

    With apologies, it is still unclear (to me) what you are asking.
    It is possible to create files using DAL, but to offer more specific guidance requires a better understanding of what it is that you want.
    A CSV is a Comma-Separate Value file. A PDF file is a printed document file containing formatted text content, graphics, lines, boxes, etc - in other words a fully-composed document.  I'm not exactly sure how a PDF and a CSV file could contain the same data.
    Are you perhaps asking to get an index of the created PDF files written as a CSV file? Something that contains a row of key transaction data along with the file name of the generated PDF? Perhaps something akin to the batch (BCH) files that can be produced per transaction recipient?
    Are you asking for an export file of all the field data that went into the creation of the document and included in the PDF? Normally a CSV has a header that describes the columns and then each row of data would be consistent with that header. Without knowing that every PDF file you create will have exactly the same number of fields defined, it is difficult to imagine that a single CSV file would be sufficient. And depending upon the number of fields and the size of the data assigned to each, this could be quite a long record per PDF in the resulting CSV file.
    Or perhaps you had in mind to get a name / value pair written for each field with data written on separate lines? This would not a be a true CSV file, but could have the name and values separated by commas if that is what you require.
    You have something specific in mind and yet, we are not in your mind.  We need more specific information on exactly what you are trying to accomplish.

  • Flat File Upload as CSV File in BPS.

    Hi Friends,
    We have to upload CSV file to BPS and as of now we are able to upload tab spaced file as per the How to Document.
    Kindly can some body post the COMPLETE CODE changes for Uploading the CSV File in both LOAD and WEB Function Modules.
    For complete code points are guaranteed.

    Hi BI,
    please check the following thread.
    Load flat file to BPS - GUI issue
    I've implemented the file upload for CSV file. please note the changes i've made -
    Code for INIT function module :-
    FUNCTION Z_BPS_FILE_UPLOAD_INIT_CSV.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_AREA) TYPE  UPC_Y_AREA
    *"     VALUE(I_PLEVEL) TYPE  UPC_Y_PLEVEL OPTIONAL
    *"     VALUE(I_PACKAGE) TYPE  UPC_Y_PACKAGE OPTIONAL
    *"     VALUE(I_METHOD) TYPE  UPC_Y_METHOD OPTIONAL
    *"     VALUE(I_PARAM) TYPE  UPC_Y_PARAM OPTIONAL
    *"     REFERENCE(IT_EXITP) TYPE  UPF_YT_EXITP OPTIONAL
    *"     REFERENCE(ITO_CHASEL) TYPE  UPC_YTO_CHASEL OPTIONAL
    *"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA OPTIONAL
    *"     REFERENCE(ITO_KYF) TYPE  UPC_YTO_KYF OPTIONAL
    *"  EXPORTING
    *"     REFERENCE(ETO_CHAS) TYPE  ANY TABLE
    *"     REFERENCE(ET_MESG) TYPE  UPC_YT_MESG
      DATA: lto_chas TYPE yto_chas,
      ls_chas     TYPE ys_chas,
      ls_exitp    TYPE upf_ys_exitp,
      ls_mesg     TYPE upc_ys_mesg,
      ls_chasel   TYPE upc_ys_chasel, "<<<INSERT
      ls_charng   TYPE upc_ys_charng. "<<<INSERT
      DATA: lt_filetab TYPE filetable,
      ls_filetab   TYPE file_table,
      l_file       TYPE string,
      l_separator  TYPE char01,
      l_action     TYPE i,
      l_count      TYPE i.
      FIELD-SYMBOLS: <f> TYPE ANY. "<<<INSERT
    Try to get file name from parameter
      READ TABLE it_exitp INTO ls_exitp WITH KEY parnm = 'FILENAME'.
      IF sy-subrc = 0.
        l_file = ls_exitp-chavl.
      ENDIF.
    If no file name is given, prompt user for it
      IF l_file IS INITIAL.
        CALL METHOD cl_gui_frontend_services=>file_open_dialog
          EXPORTING
            window_title            = 'Select Upload File'
            default_extension       = 'csv'
            file_filter             = 'Text Files (*.csv)'
          CHANGING
            file_table              = lt_filetab
            rc                      = l_count
            user_action             = l_action
          EXCEPTIONS
            file_open_dialog_failed = 1
            cntl_error              = 2
            OTHERS                  = 3.                        "#EC NOTEXT
        IF sy-subrc <> 0.
          CLEAR ls_mesg.
          MOVE-CORRESPONDING syst TO ls_mesg.
          APPEND ls_mesg TO et_mesg.
          EXIT.
        ENDIF.
        CALL METHOD cl_gui_cfw=>flush.
        LOOP AT lt_filetab INTO ls_filetab.
          l_file = ls_filetab.
        ENDLOOP.
        CHECK l_action = 0.
      ENDIF.
      l_separator = 'X'.
    Upload file from front-end (PC)
    File format is tab-delimited ASCII
    l_separator = ';' .
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_file
         filetype                = 'DAT'
         has_field_separator     = l_separator
        TABLES
          data_tab                = gt_file_csv
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        CLEAR ls_mesg.
        MOVE-CORRESPONDING syst TO ls_mesg.
        APPEND ls_mesg TO et_mesg.
        EXIT.
      ENDIF.
    Create one dummy combination
    If we don't do this, the upload won't work since the second function
    will not be executed at all in case no transaction data exists so far.
    The combination must be a subset of the planning level!
      " >>> BEGIN INSERT
      CLEAR ls_chas.
      LOOP AT ito_chasel INTO ls_chasel.
        READ TABLE ls_chasel-t_charng INTO ls_charng INDEX 1.
        IF sy-subrc = 0.
          ASSIGN COMPONENT ls_chasel-chanm OF STRUCTURE ls_chas TO <f>.
          IF sy-subrc = 0.
            <f> = ls_charng-low.
          ENDIF.
        ENDIF.
      ENDLOOP.
      " <<< END INSERT
      COLLECT ls_chas INTO lto_chas.
      eto_chas = lto_chas.
    ENDFUNCTION.
    Include should contains following declarations-
    TYPES:      begin of itab_CSV,
                           text(255) type c,
                     end of itab_CSV.
    Global table to temporarily store loaded data.
    DATA: gt_file_CSV TYPE STANDARD TABLE OF itab_csv WITH DEFAULT
    KEY.
    Hope it will help you.
    Regards
    Tarun

  • Upload a .CSV File into an Internal table

    Hi,
    What are the parameters to be filled into the Function Modules "GUI_UPLOAD" and "ALSM_EXCEL_TO_INTERNAL_TABLE" to Upload a .CSV File into an internal table.
    Please send a sample code to support this....
    Regards,
    Aadhi.

    Hi,
            Check the below code.
    TYPE-POOLS: truxs.
    TYPES:
      BEGIN OF ty_line,
        vbeln LIKE vbap-vbeln,
        posnr LIKE vbap-posnr,
      END OF ty_line.
    *data:  ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY.
    DATA: itab   TYPE STANDARD TABLE OF ty_line WITH DEFAULT KEY.
    DATA: itab1  TYPE truxs_t_text_data.
    SELECT
      vbeln
      posnr
      UP TO 10 ROWS
      FROM vbap
      INTO TABLE itab.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
      EXPORTING
        i_field_seperator    = ';'
      TABLES
        i_tab_sap_data       = itab
      CHANGING
        i_tab_converted_data = itab1
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = 'd:\TEMP\test1.txt'
      TABLES
        data_tab = itab1
      EXCEPTIONS
        OTHERS   = 1.
    IF sy-subrc eq 0.
      WRITE: 'Data downloaded successfully'.
    ENDIF.
    DATA: BEGIN OF IEXCEL OCCURS 0.
          INCLUDE STRUCTURE ALSMEX_TABLINE.
    DATA: END OF IEXCEL.
    PARAMETERS: FILENM   LIKE rlgrap-filename MEMORY ID M01,
                NOHEADER AS CHECKBOX.
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      exporting
        filename                      = FILENM
        i_begin_col                   = 1
        i_begin_row                  = 1
        i_end_col                     = 100
        i_end_row                     = 30000
      tables
        intern                        = IEXCEL
      EXCEPTIONS
        INCONSISTENT_PARAMETERS       = 1
        UPLOAD_OLE                    = 2
        OTHERS                        = 3.
    if sy-subrc <> 0.
       WRITE: / 'EXCEL UPLOAD FAILED ', FILENM, SY-SUBRC.
    endif.

  • Upload a CSV File

    I'm on 9i on a Microsoft Windows Server 2003.
    What are some of the native tools to Oracle 9i for uploading a CSV File to a Table in the Database?

    Alex
    I realize that "evangelist" is part of your job title. But are you really intending to exhume any old thread the search engine chucks that which may be relevant to your product? Because you are really going to start annoying people soon.
    Obviously you will claim that your company's dual GPL/commercial licensing policy means that you are not violating these forums' Terms of use. But as your ultimate aim is no doubt to get people to buy the non-GPL option I suggest that you are breaking this rule: Forums shall be used in a noncommercial manner only.
    Furthermore, a sufficient amount of this type of thread-bombing would (IMO) constitute unsolicited bulk e-mail, "junk mail," "spam" or chain letters.
    Namaste, APC

  • Upload a csv file in application server with the specified codepage(Poland

    Hi,
    i want to upload a csv file in application server with the specified codepage ( for poland ) , please let me know how to use open dataset for that.?
    Anurag

    I would upload the file with transaction CG3Z in binary mode and do the code page translation with a report: read from server an save with different name.

  • How can I upload a (image) file through an applet ?

    How can I upload a (image) file through an applet ?

    have a look at http://www.haller-systemservice.net/jupload/
    i'm using Apache Jakarta HTTPClient to create a new HTTP connection to the webserver and sending a new POST request, which holds the image file. (So it's RFC1867 conform)
    there is also an open source implementation of such an applet on sourceforge. it's also called JUpload, but i think it's not maintained any more.

  • Netbeans - How to Upload a csv File

    Hi all
    A J2EE question from a java beginner:
    I am using NetBeans and JBoss to develop a web application.
    I need to create a JSP page for user to upload a csv file and then read from the csv file (the file is in certain fixed format).
    The csv file will be read line by line to be updated into database.
    In JSP Page I have this:
    <td align="left" scope="col"><input type="file" name="meterList" id="meterList"></td>
    <td><input type="submit" name="upload" id="upload" value="Upload File" ></td>What should I do in Servlet when I clicked on the "Upload" button?
    How if I want to control the uploading size and type of the the file?
    How to get the file to be processed in servlet?
    Your help is much appreciated.
    Thanks alot.

    this question has been asked a million times
    try searching next time
    and uploading a csv file has nothing to do with netbeans

  • Problem in uploading xls/csv file with Email address through oracle forms

    Dear all,
    I've created an interface to upload data from xls
    and csv files to database tables.
    I'm sucessed in this. Now i'm facing an issue.
    If the xls/csv file having Email address,the
    upload activity is not working..junk characters is
    getting stored.
    I came to know that, xls .csv file having email
    address with hiperlink. so this may cause the
    issue (just guessing)..
    we can't restrict users to upload email without
    hiperlink.. so what is the alternative to do
    this..
    Email address
    [email protected]
    [email protected]
    [email protected]
    etc...

    Can you give some more information:
    What versions of Forms, database, Java, browser are you using?
    How are you uploading data? Please show us your code.
    What do you mean by "email with a hyperlink"?

  • Crystal report - generate CSV file through Java interface

    Hi,
    I need to generate a Character Seperated File through Crystal Report 10 using Java.
    What constant stands for CSV Format and what value of SI_PROGID we can provide to pull the CSV format.
    Eg. SI_PROGID = ceProgID.EXCEL or SI_PROGID = ceProgID.PDF .....
    Currentlly we are crystalLibs.jar to connect the Crystal server.
    Thanks In Advance

    In BusinessObjects Enterprise installations, the following ProgIDs are valid.
    CrystalEnterprise.Analytic
    CrystalEnterprise.AppFoundation
    CrystalEnterprise.Calendar
    CrystalEnterprise.Category
    CrystalEnterprise.Connection
    CrystalEnterprise.Designer
    CrystalEnterprise.Destination
    CrystalEnterprise.DiskUnmanaged
    CrystalEnterprise.Event
    CrystalEnterprise.Excel
    CrystalEnterprise.Folder
    CrystalEnterprise.FavoritesFolder
    CrystalEnterprise.Ftp
    CrystalEnterprise.Hyperlink
    CrystalEnterprise.Inbox
    CrystalEnterprise.InfoView
    CrystalEnterprise.LicenseKey
    CrystalEnterprise.Managed
    CrystalEnterprise.MyInfoView
    CrystalEnterprise.ObjectPackage
    CrystalEnterprise.Overload
    CrystalEnterprise.Pdf
    CrystalEnterprise.PersonalCategory
    CrystalEnterprise.Powerpoint
    CrystalEnterprise.Program
    CrystalEnterprise.Report
    CrystalEnterprise.Rtf
    secEnterprise
    secLDAP
    CrystalEnterprise.Server
    CrystalEnterprise.ServerGroup
    CrystalEnterprise.Shortcut
    CrystalEnterprise.Smtp
    CrystalEnterprise.Txt
    CrystalEnterprise.Universe
    CrystalEnterprise.User
    CrystalEnterprise.UserGroup
    CrystalEnterprise.Webi
    CrystalEnterprise.Word

  • Upload a CSV file directly to an Oracle directory?

    We have some existing packaged code that reads CSV files from an Oracle directory into the database via external tables. Currently, the files are placed in the directory via FTP, but we'd like to upload them via APEX if possible.
    As far as I can tell, APEX file upload will store a file as a BLOB in an APEX table. Is there any way to re-direct the file upload to put file straight into the Oracle directory instead? The files will be copied from a Windows client to an Oracle server on Unix.
    We're still on APEX v.3.2 unfortunately.
    Edited by: chriswebster on Mar 31, 2011 10:05 AM

    >
    Similarly, we don't really want to have to extract a BLOB from the APEX file-upload table and re-create the CSV file either, as this seems like a lot of work to do a simple thing.
    >
    Not really, just a page process...
    PROCEDURE blob2file (p_blob         BLOB,
                         p_directory    VARCHAR2 := 'MY_DIR',
                         p_filename     VARCHAR2 := 'my.csv')
    IS
       t_fh    UTL_FILE.file_type;
       t_len   PLS_INTEGER := 32767;
    BEGIN
       t_fh := UTL_FILE.fopen (p_directory, p_filename, 'wb');
       FOR i IN 0 .. TRUNC ( (DBMS_LOB.getlength (p_blob) - 1) / t_len)
       LOOP
          UTL_FILE.put_raw (t_fh, DBMS_LOB.SUBSTR (p_blob, t_len, i * t_len + 1));
       END LOOP;
       UTL_FILE.fclose (t_fh);
    END;?
    Cheers
    Ben

Maybe you are looking for

  • ITunes & QuickTime will install but not open after Windows XP laptop crash

    Alright, this may be a repeat question from a long time ago, but I don't have the time to dig through 1,000+ posts so I'll just put it out there. Here's the situation: *Backed up my entire hard drive including iTunes 8.1 and library to external drive

  • Remove all tooltips from PDF Fom in Acrobat 9 Pro

    I am trying to convert an Excel form into a PDF form. There are a couple of hundred fields in the form. By default, when I convert the excel file to a PDF form, Acrobat names all the fields automatically and this name is added to the tooltip. So when

  • Bug fix in 7.2?

    I've been trying to make the rewire work with reason. It works great until I add an Audio Unit to an instrument track then reason plays however the loop only plays one time. Do anyone knows if they fix that in 7.2? Or any other way to fix?

  • Reorganizing and moving photos on HD

    Can I reorganize the structure of my photo files on my hd? If so, do i lose all my iphoto work? I want to store all my photos on my large external hard drive and be able to temporarily move some files to macbook to work on for project, then transfer

  • In the music section on my iphone, the "album" icon only shows one album even though I have downloaded several - any ideas? Thanks

    if i press the album icon it opens one album only (It happens to bethe first one i downloaded from the store. I have about  25 albums on the device that i can acess via "artists" icon. Any thought will be most welocme Thanks