How to load CSV files into HANA

1.- Create an CSV file with your data
2.- Copy the file to dropbox/yourname inside the HANA box
3.- Create a table in HANA with the structure of your file
4.- create the control file BBB with the following information:
import data
into table XXX."YYY"
from 'ZZZ.csv'
record delimited by '\n'  
fields delimited by ','
optionally enclosed by '"'
error log 'Text_Tables.err'
Where XXX is your schema, YYY is your HANA Table and ZZZ is your file
5.- Open an Script File and write the following:
LOAD FROM '/filer/dropbox/yourname/BBB.ctl';
where BBB is the name of your control file
Greetings,
Blag.

With the recent upgrade to the HANA SP3...the method to upload files to HANA has been slightly changed...so here's the updated tutorial:
1.- Create an CSV file with your data
2.- Copy the file to the HANA Dev Center
3.- Open a FTP connection to ftp.sapdevcenter.com
(You can find the user name and password by doing a select to SYSTEM.FTP_SERVER)
and....*Don't paste the Username or password here or any other place!*
4.- Create a folder with your name on the FTP site and copy the file there
4.- Create a table in HANA with the structure of your file
5.- create the control file BBB with the following information:
import data
into table XXX."YYY"
from 'ZZZ.csv'
record delimited by '\n'
fields delimited by ','
optionally enclosed by '"'
error log 'Text_Tables.err'
Where XXX is your schema, YYY is your HANA Table and ZZZ is your file
5.- Open an Script File and write the following:
IMPORT FROM '/dropbox/yourname/BBB.ctl';
where BBB is the name of your control file
I just test it and it works...if it doesn't work for you, please let me know
Greetings,
Blag.

Similar Messages

  • Issue loading CSV file into HANA

    Hi,
    From last couples of weeks i am trying to load my CSV file into HANA Table, but i am unable to succeed.
    I am getting error "Cannot open Control file, /dropbox/P1005343/CRM_OBJ_ID.CTL". I have followed each and every step in SDN, still I could not load data into my HANA table.
    FTP: /dropbox/P1005343
    SQL Command:
    IMPORT FROM '/dropbox/P1005343/crm_obj_id.ctl'
    Error:
    Could not execute 'IMPORT FROM '/dropbox/P1005343/crm_obj_id.ctl''
    SAP DBTech JDBC: [2]: general error: Cannot open Control file, /dropbox/P1005343/crm_obj_id.ctl
    Please help me on this
    Regards,
    Praneeth

    Hi All,
    I have successfully loaded the file into HANA database in folder P443348 but while importing file, I am getting the following error message such as
    SAP DBTECH JDBC: [2]  (at 13) : general error: Cannot open Control file, "/P443348/shop_facts.ctl"
    This is happening while I am executing the following import statement
    IMPORT FROM '/P443348/shop_facts.ctl';
    I have tried several options including changing the permissions of the folders and files to no success. As of now my folder has full access, which is 777
    Any help would be greatly appreciated so that I can proceed further
    Thanks
    Vamsidhar

  • How to load .csv file into an abap table

    Hi,
    Pls provide me with a sample code on how to load a .csv file (with column header and rows of data) into a table in sap.
    Thank you!
    Moderator Message: A google search would yield faster results, so search!
    Edited by: Suhas Saha on Jan 16, 2012 5:30 PM

    Hi,
    Using GUI_upload convert file to internal table data.
    Using the below statement separate header and data from CSV.
    Read t_itab into wa_titab index 1.
    delete t_itab from wa_itab.
    Create an internal table with the structure same as 'CSV' file and use the below statement to separate.
    loop at t_itab into wa_itab.
          split wa_itab-rec at ',' into var1 var2 var3.
          wa_output-v1 = var1.
          wa_output-v2 = var2.
          wa_output-v3 = var3.
        append wa_output to t_output.
    endloop.
    Edited by: syamsundr on Jan 16, 2012 11:54 AM

  • *** Question How to load a file into BI-Integrated Planning and use WAD 7.0

    Hi, I created an manual DTP upload to my planning infocube and it works fine.  The transformation rules convert 0CALMONTH into the relevant Calendar and Fiscal characteristics.   So all of my Time Characteristics are fine, both Calendar and Fiscal.
    However, When using the "How to load a file into BI-Integrated Planning and use WAD 7.0" solution, only the Calendar Characteristics are populated and not the Fiscal.   The upload application somehow knows to populate the 0CALMONTH2, 0CALQUART1, 0CALQUARTER, and 0CALYEAR.  
    How can I get the upload to populate my Fiscal Period Characteristics?
    Would it be best to modify the "Upload Application, or can I write a planning function to update the fiscal characteristics, or some other way?
    Thanks!

    My planning data is being uploaded via the SDN Planning File Upload Solution. What I did was end up modifiying the upload class ZCL_RSPLF_FILE_UPLOAD Method EXECUTE.
    I added the following code if anyone is interested.
    *{ INSERT BWDK902323 1
    THIS SECTION OF CODE POPULATES THE FISCAL PERIOD CHARACTERISTICS
    USING THE FISCAL YEAR VARIANT 'NK' AND THE CALENDAR MONTH/YEAR
    FIELD-SYMBOLS <0FISCVARNT> TYPE /BI0/OIFISCVARNT. " Fiscal Year Variant
    FIELD-SYMBOLS <0FISCYEAR> TYPE /BI0/OIFISCYEAR. " Fiscal Year
    FIELD-SYMBOLS <0FISCPER> TYPE /BI0/OIFISCPER. " Fiscal Year/Period
    FIELD-SYMBOLS <0FISCPER3> TYPE /BI0/OIFISCPER3. " Posting Period
    FIELD-SYMBOLS <0CALMONTH> TYPE /BI0/OICALMONTH. " Calendar Month/Year
    ASSIGN COMPONENT '0CALMONTH' OF STRUCTURE <L_S_DATA> TO <0CALMONTH>.
    ASSIGN COMPONENT '0FISCPER' OF STRUCTURE <L_S_DATA> TO <0FISCPER>.
    ASSIGN COMPONENT '0FISCVARNT' OF STRUCTURE <L_S_DATA> TO <0FISCVARNT>.
    ASSIGN COMPONENT '0FISCPER3' OF STRUCTURE <L_S_DATA> TO <0FISCPER3>.
    ASSIGN COMPONENT '0FISCYEAR' OF STRUCTURE <L_S_DATA> TO <0FISCYEAR>.
    <0FISCVARNT> = 'NK'.
    CALL FUNCTION 'FISCPER_FROM_CALMONTH_CALC'
    EXPORTING
    IV_CALMONTH = <0CALMONTH>
    IV_PERIV = <0FISCVARNT>
    IMPORTING
    EV_FISCPER3 = <0FISCPER3>
    EV_FISCPER = <0FISCPER>
    EV_FISCYEAR = <0FISCYEAR>.
    *} INSERT

  • Uregnt - How to Load Flat File into BW-BPS using Web Browser

    Hello,
    We have followed the 'How to Load Flat File into BW-BPS using Web Browser' guide to build BSP web front-end to upload flat file.  Everything works great but we have a requirement to populate the Planning Area Variables based on BSP drop down list with values.  Does anyone know how to do this?  We have the BSP coded with drop down list all we need to do now is populate variables.  We can populate the variables through the planning level (hardcoded) but we need to populate them through the web interface.
    Thanks,
    Gary

    Hello Gary,
    We have acheived the desired result by not too a clean method but it works for us.
    What we have done is, we have the link to load file in a page where the variables can be input. The user would then have the option to choose the link to load a file for the layout in that page.
    By entering the variable values in the page, we are able to read the variables for the file input directly in the load program.
    Maybe this approach might help.
    Sunil

  • How to load flat file into BW BPS

    hi,
    how to load flat file into BW BPS ?

    Have a read through this;
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20load%20a%20flat%20file%20into%20bw-bps%20using%20a%20web%20browser.pdf

  • How do i import my local csv files into HANA database as temporary tables  using java program?

    I want to import my local csv file into database for further apply Join with other tables programmatic in JAVA

    Hi Vivek,
    Please go through the following blogs and video to resolve your issue.
    Loading large CSV files to SAP HANA
    HANA Academy - Importing Data using CTL Method - YouTube
    Hope it helps.
    Regards
    Kumar

  • How to convert csv files into java bean objects?

    Hi,
    I have a CSV file, I want to store the data availabale in that csv file into java bean, I am new to this csv files how can I convert CSV files into java beans.
    Please help me.
    Adavanced Thanks,
    Mahendra

    You can use the java.io API to read (and write) files. Use BufferedReader to read the CSV file line by line. Use String#split() to split each line into an array of parts which were separated by comma (or semicolon). If necessary run some escaping of quotes. Finally collect all parts in a two-dimensional List of Strings or a List of Javabeans.
    java.io API: [http://www.google.com/search?q=java.io+javase+api+site:sun.com]
    java.io tutorial: [http://www.google.com/search?q=java.io+tutorial+site:sun.com]
    Basic CSV parser/formatter example: [http://balusc.blogspot.com/2006/06/parse-csv-upload.html]

  • Load CSV file into single CLOB

    Hello Oracler,
    is there a good way to load a csv file into PL/SQL a Clob variable ?
    Ilja

    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978

  • How to load csv file in oracle table

    Hi,
    i have csv files to which i want to load the csv file data and table structure in oracle. my csv files on the window machine but database is runing on ibm aix.so how to do it please any one can help me about. thanks a lot in advance
    i know th syntax below
    $sqlldr userid=username/password control=<filename> log=<log filename>

    Hello,
    Yes, with SQL*Loader you can do it.
    But first you have to create a Table into your database with columns and datatype matching
    the content of you "csv" file.
    Then, you'll have to prepare a control file and use the option fields terminated by "," as it's
    a "csv" format.
    Then, you could execute your statement.
    Please, find enclosed a link with some example about SQL*Loader and "csv" file:
    [http://www.orafaq.com/wiki/SQL*Loader_FAQ]
    Hope this help.
    Best regards,
    Jean-Valentin

  • How to load PDF files into oracle database and display them in APEX

    Hi All,
    We have a requirement for loading the Loading PDF files (lots of PDf files) to the oracle database and then display the PDF files in the Oracel APEX report.
    So that User can view the PDF files. Our current APEX verison is 3.2..
    Please let me know how to implement it and where to find the sample application!
    Thanks in advanced!
    Jane

    Thanks Tony for your quick response!
    We need to load a lot of PDfs (history + current).
    I have a questions about the SQL loader. I am trying to insert a pdf file into a table by following the oracle loading sample:
    http://download.oracle.com/docs/cd/B10501_01/text.920/a96518/aload.htm
    Example Data File: loader2.dat
    This file contains the data to be loaded into each row of the table, articles_formatted.
    Each line contains a comma separated list of the fields to be loaded in articles_formatted. The last field of every line names the file to be loaded in to the text column:
    Ben Kanobi, plaintext,Kawasaki news article,../sample_docs/kawasaki.txt,
    But i don't know to where should I put my pdf file on the server.
    for example:
    ,../sample_docs/kawasaki.txt,
    Where is the file 'kawasaki.txt'??
    I try my local path, it didn't work. like c:\temp.
    then I loaded teh PDf file into our server(/findev20/olmtest/orafin/11.5.7/olmtestcomn/temp) , and In my data file. I put the path
    1, pdf_emp1,../findev20/olmtest/orafin/11.5.7/olmtestcomn/temp
    but I got the error: the system can not find the file specified.
    Where should I put the PDf files on the server and how to specify the path in the data file?
    Thanks!
    Jane

  • Load CSV file into a table when a button is clicked by the user

    Hello,
    Can anyone please help me out with this issue, I have a form where in a user comes and uploads a CSV file and clicks a button, when the button is clicked - it should load the CSV file data into the database table for the corresponding columns.
    Can anyone please suggest me a possible solution or an approach.
    Thanks,
    Orton
    Edited by: orton607 on May 5, 2010 2:00 PM

    thanks fro replying.
    I have tried your changes but its not working. One more question is that I am having one column which contains commas, when I tried to load the file its failing. I think its the problem with commas. So I have changed the code to use the replace function for that column, then also its not working. Can anyone please suggest a possible approach. Below is my source code for your reference.
    DECLARE
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    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;
    l_cnt BINARY_INTEGER := 0;
    l_stepid NUMBER := 10;
    BEGIN
    delete from sample_tbl;
    -- 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
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    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);
    -- Insert data into target table </span>
    EXECUTE IMMEDIATE 'insert into sample_tbl(col1..col12)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12)'
    USING
    v_sr_no,
    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),
    REPLACE(v_data_array(9), ':', ','),
    to_date(v_data_array(10),'MM/DD/YYYY'),
    v_data_array(11);
    -- Clear out
    v_line := NULL;
    v_sr_no := v_sr_no + 1;
    l_cnt := l_cnt + SQL%ROWCOUNT;
    END IF;
    END LOOP;
    COMMIT;
    l_stepid := 20;
    IF l_cnt = 0 THEN
    apex_application.g_print_success_message := apex_application.g_print_success_message || ' Please select a file to upload ' ;
    ELSE
    apex_application.g_print_success_message := apex_application.g_print_success_message || 'File uploaded and processed ' || l_cnt || ' record(s) successfully.';
    END IF;
    l_stepid := 30;
    EXCEPTION WHEN OTHERS THEN
    ROLLBACK;
    apex_application.g_print_success_message := apex_application.g_print_success_message || 'Failed to upload the file. '||REGEXP_REPLACE(SQLERRM,'[('')(<)(>)(,)(;)(:)(")('')]{1,}', '') ;
    END;
    Below is the function which I am using to convert hex to decimal
    create or replace function hex_to_decimal( 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;
    thanks,
    Orton

  • How to load rm file into ordAudio column?

    Hello everybody,
    I made many attempts trying to insert aa.mp3(3.63Mb) and bb.rm(3.58Mb) file into ORDSYS.ordAudio column respectively with the same way.
    the result is: aa.mp3 was inserted successfully, but the bb.rm was not. It showed the error message: "java.sql.SQLException:ORA-01401:inserted value too large for column"
    Why? How can I insert *.rm into the ordAudio column?
    main code are grateful.

    >
    >
    1.tonight, I made another trying to insert aa.mp3(3.63Mb) and bb.rm(3.58Mb) file into ORDSYS.ordAudio column respectively with the same way.
    the result is: aa.mp3 was inserted successfully, but the bb.rm was not. It showed the error message: "java.sql.SQLException:ORA-01401:inserted value too large for column"
    And the main code is as following:
    private final static String EMPTY_AUDIO = "ordsys.ordaudio.init()"; //declare the EMPTY_AUDIO
    stmt = (OraclePreparedStatement)conn.prepareStatement( //
    "insert into TAB_NOAUDIT_AUDIO(NOAU_AU_SERIALNUMBER,"+
    "NOAU_AU_TYPE,NOAU_AU_KEYWORD,NOAU_AU_FILENAME,"+
    "NOAU_AU_MEDIA)"+
    " values (?,?,?,?," + EMPTY_AUDIO +")" );
    stmt.setString( 1, id );
    stmt.setString( 2, filetype );
    stmt.setString( 3, new String(keyword.getBytes("ISO8859-1")) );
    stmt.setString( 4, new String(filename.getBytes("ISO8859-1")) );
    // System.out.println("after 4th set..()!!");
    stmt.executeUpdate();
    stmt.close();
    //load the audio media file into table
    stmt=(OraclePreparedStatement)conn.prepareStatement(
         "select NOAU_AU_MEDIA from TAB_NOAUDIT_AUDIO where NOAU_AU_SERIALNUMBER = ? for update" );
    stmt.setString( 1, id );
    rset = (OracleResultSet)stmt.executeQuery();
    while(rset.next()) {
    media = (OrdAudio)rset.getCustomDatum( 1, OrdAudio.getFactory());
    File file = new File(filepath);
    FileInputStream fStream = new FileInputStream(file);
    media.loadDataFromInputStream(fStream);
    // System.out.println("after aumedia.loadDataFromInputStream()!!");
    fStream.close();
    I don't know why the error occured?
    Whether the rm file format is not recognized by ORDSYS.ordAudio or not?
    How can i do next?
    The error you get has nothing to do with the size of the media data. The error you are getting has to do with another field somewhere I think. The error you say has nothing to do with media data, but regular SQL.
    It all depends on where the error is... Do you get the error on the media.loadDataFromInputStream(fStream);? I suspect, you are getting the error on the insert. and that id or filetype are too big for the column.
    Could you tell me where the problem occurs? On the first insert? on the update?? I really can't debug with the amount of information here.
    In general, for debugging problems, you need to break it down smaller to find the errror.
    Pleas break down your insert to find the problem.
    2.Would you mind telling me more detail step or code for copying ordAudio data from table
    to another table with the same ORDSYS.ordAudio column property?
    One media column to another would simply be
    select sound into soundvar from oldtable where .....
    insert into newtable(newsound) values (soundvar) where ...;
    If from a lob....
    select lob into lobvar from....
    soundvar.source.localdata := lob;
    soundvar.setlocal();
    soundvar.setProperties();
    Larry
    Larry

  • How to load csv file to table using ssis

    Hi,
    i have loaded the csv file to table using ssis, it is working file but record is mismatch.
    source data :
    col1 col2 col3 col4
    aa, bb, this is sample,data for the details, this is 
    column delimiter - comma
    col3 - record contains comma. so col3 record after the comma is added with the as col4
    i need the col3 record with comma.
    so what is the column delimiter will use ?
    Regards,
    abdul Khadir

    Hi Abdul,
    Based on your description, you want to distinguish a comma is used for column separator or used in address column in a text file, then load the data from the text file to SQL Server table.
    As per my understanding, if you can replace the comma column separator to another delimiter like semicolon (;), just do it. Then we can select Semicolon {;} as Column delimiter for the Flat File Connection Manager. Or ensure all columns are enclosed in double
    quotes ("). Then we can set the double quotes (") as Text qualifier for the Flat File Connection Manager, and the commas will be loaded as part of the string fields.
    If you can't have that done, because computers don't know the context of the data, you would have to come up with some kind of rules that decides when a comma represents a delimiter, and when it is just part of the text. I think a custom script component
    would be necessary to pre-process the data, identify where a comma is part of an address, and then treat that as one field.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to load Excel files into DB on Unix?

    Hi folks,
    Question>
    ======================================
    Our source db is on HPUX, and we have Excel files transported onto the HPUX via FTP everyday, how can I load the Excel data into the source db with Heterogeneous Services on Unix?
    I know that we can do these if the source db is on Windows as that way we can create the System DSN in Windows ODBC Administrator before we configurate HS listener/tnsname.
    But in this case, it's on Unix! Is ODBC available on Unix? What shall i do?
    Do you have any idea?
    Thanks & Have a nice day everyone!
    eilison
    [email protected]

    check this out
    http://www.unixodbc.org/

Maybe you are looking for

  • Use of DYNP_VALUES_READ and subsequently DYNP_VALUES_UPDATE

    Dear Exüerts: I have a database table: Zlt_mita with fields M1 (Employee Name) and M2 (Employee Code). Like:         M1                          M2          Chandan Kumar        DAS0907           Petra Sutor.               DAS0906    ANd so on..... R

  • BALANCE SHEET IN SAP?

    Does anyone know the transaction code to run a simple Balance Sheet in SAP. Are there Balance Sheet reports within SAP or are they in the Business Warehouse. Any information would be greatly appreciated. Thanks, Linda

  • Met ora-07445 on oracle 10.2.0.4 of Windows 2003

    Hello, I was running an PL/SQL application using PL/SQL Developer and after a while, the application will be disconnected from the database with error 03113: end-of-file on communication channel. I checked the alert.log file of the database, at that

  • SIT - Error 14104

    Hello all, With Matlab & Simulink r2008b, Win XP 32, Microsoft Visual C++ 2008 Express, Labview 8.6 and SIT 5.0.1, when I'm trying to run the SIT generated dll on my PXI, i'm getting the following error (see attachment). My model is working in the si

  • Having Problems with wpa_supplicant

    So for some reason wpa_supplicant occassionally works for me, but for the great majority of the time does not.  I feel as though I have tried everything.  At the moment, I have a very simple configuration.  My wpa_supplicant.conf is the standard home