Error for the uploading csv file to database

Hi i tried to upload the csv file to database and i am getting error as
<cffile action="read" file="#data_dir_upload#/di_audit_corp_upc_ldr_tbl.csv" variable="di_audit_corp_upc_ldr_tbl">
<!--- loop through the CSV-TXT file on line breaks and insert into database --->
<cfloop index="index" list="#di_audit_corp_upc_ldr_tbl#" delimiters="#chr(10)##chr(13)#">
    <cfquery  datasource="#request.dsnCAO#">   
            <!--- SET ANSI_WARNINGS OFF      --->
         INSERT INTO [dbo].[di_audit_corp_upc_ldr_tbl]
                            ( cpt_dpt_cd,cpt_com_cd,sub_com_cd,con_upc_no,pid_lng_dsc_tx,pid_sht_dsc_tx)
         VALUES
                  (<cfqueryparam value='#left(trim(listgetAt('#index#',2,',')),2)#' cfsqltype="cf_sql_char">,
                   <cfqueryparam value='#left(trim(listgetAt('#index#',3,',')),3)#' cfsqltype="cf_sql_char">,
                   <cfqueryparam value='#left(trim(listgetAt('#index#',4,',')),5)#' cfsqltype="cf_sql_char">,
                   <cfqueryparam value='#left(trim(listgetAt('#index#',1,',')),13)#' cfsqltype="cf_sql_varchar">,                  
                   <cfqueryparam value='#left(trim(listgetAt('#index#',5,',')),25)#' cfsqltype="cf_sql_varchar">,
                   <cfqueryparam value='#left(trim(listgetAt('#index#',6,',')),12)#' cfsqltype="cf_sql_varchar">)    
   </cfquery>
</cfloop>
Error:
An error occurred while executing DTS package to import data.
Invalid list index 6.
In function ListGetAt(list, index [, delimiters]), the value of index, 6, is not a valid as the first argument (this list has 5 elements). Valid indexes are in the range 1 through the number of elements in the list.
i am unable to solve this issue can any one will help me to solve this issue
Thanks,
Kiran

I take it your are trying to use a csv file to insert new data into a database, using flex and coldfusion?
if so, then I would load the file in flex using cffile in ColdFusion and then use Load Data if you are using MySQL
This can show you more about it.
http://blog.tygate.com/?p=75
We get very large csv files ftp'd to us every week, and we have to load them in to the db. this works for us.

Similar Messages

  • Uploading csv file into database using apex

    Dear all
    I am using apex 4 and oracle express 10g, i need to upload .csv file into the database for one of my appls, i have referred discussion forum for solutions, i found also, but some how its not working for me.
    below mentioned is error and the code
    ERROR:
    ORA-06550: line 38, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 38, column 8: PL/SQL: Statement ignored ORA-06550: line 39, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 39, column 8: PL/SQL: Statement ignored ORA-06550: line 40, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 40, column 8: PL/SQL: Statement ignored ORA-06550: line 41, column 8: PLS-00221: 'V_DATA_ARRAY' is not a proc
    Error
    OK
    CODE:
    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;
    BEGIN
    -- Read data from wwv_flow_files
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv';
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- Read and convert binary to char
    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
    IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities
    v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data
    v_data_array := wwv_flow_utilities.string_to_table (v_line);
    -- Insert data into target table
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    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);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);
    -- Clear out
    v_line := NULL;
    END IF;
    END LOOP;
    END;
    what i understand from this is system does not identify v_data_array as array for some reasons, please help me.
    initially system was giving error for hex_to_decimal, but i managed to get this function on discussion forum and now it seems to be ok. but v_data_array problem is still there.
    thanks in advance
    regards
    Uday

    Hi,
    Mistakes in your sample I did correct
    Problem 1
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv'; to
    select blob_content into v_blob_data
    from wwv_flow_files where name = :P1_FILE;Problem 2
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    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);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);  to
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    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),
    v_data_array(9),
    v_data_array(10),
    v_data_array(11);  And I did create missing table
    CREATE TABLE TABLE_X
        v1  VARCHAR2(255),
        v2  VARCHAR2(255),
        v3  VARCHAR2(255),
        v4  VARCHAR2(255),
        v5  VARCHAR2(255),
        v6  VARCHAR2(255),
        v7  VARCHAR2(255),
        v8  VARCHAR2(255),
        v9  VARCHAR2(255),
        v10 VARCHAR2(255),
        v11 VARCHAR2(255)
      );Regards,
    Jari
    Edited by: jarola on Nov 19, 2010 3:03 PM

  • FLOW_EXCEL_OUTPUT_R error in the downloaded csv file

    Hello,
    I'm trying to use the functionality of the FLOW_EXCEL_OUTPUT_R as follows:
    href="f?p=&APP_ID.:14:&SESSION.:FLOW_EXCEL_OUTPUT_R&P_REGION_ID._en"
    Where the computation for P_REGION_ID is:
    SELECT region_id  FROM apex_application_page_regions
    WHERE        application_id = :app_id
    AND page_id = :app_page_id
    AND region_name = 'CSV export'
    In the downloaded CSV file i get the following:
    - the first row: +<||div id="report_33994800669487811_catch">+
    - the last 2 row: +<||pre>report error:+
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error<||/pre>
    (|| - sign is so I can show the tags in the post)
    The rest of the data is downloaded ok.
    But still how can i get rid of these errors?
    Thanks,
    Adela

    It seems that the problem was caused by the "_en" termination (FLOW_EXCEL_OUTPUT_R&P_REGION_ID.*_en*).
    But is there any way to get rid of the <||div id="report_33994800669487811_catch"> <||/div> tags from the begining, respective the end of the CSV file ?
    Thanks,
    Adela

  • How to approach for downloading a CSV file?

    I'm running the following query and  QoQ . Could you tell me how should I proceed for the "Download  CSV" file option?
        <!--- QoQ for FIRSTCONN --->
        <cfquery datasource = "XX.XX.X.XX" name="master1">
             SELECT STR_TO_DATE(date_format(Timedetail,'%m-%d-%Y'),'%m-%d-%Y') as FIRSTCONN
                    , COUNT(Timedetail) as FIRSTOccurances
                    , EVENTS
             FROM  MyDatabase
             WHERE EVENTS = "FIRST"
             GROUP BY FIRSTCONN ;
        </cfquery>
        <!--- Detail Query --->
        <cfquery dbtype="query" name="detail1">
            SELECT  *
            FROM master1
            WHERE FIRSTCONN  >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_varchar">
            AND   FIRSTCONN  <  <cfqueryparam value="#dateAdd('d', 1,form.enddate)#" cfsqltype="cf_sql_varchar">;
        </cfquery> 
        <!--- QoQ for SECONDCONN --->
        <cfquery datasource = "XX.XX.X.XX" name="master2">
            SELECT STR_TO_DATE(date_format(Timedetail,'%m-%d-%Y'),'%m-%d-%Y') as SECONDCONN
                   , COUNT(Timedetail) as SECONDOccurances
                   , EVENTS
            FROM  MyDatabase
            WHERE EVENTS = "SECOND"
            GROUP BY SECONDCONN ;
        </cfquery>
        <cfquery dbtype="query" name="detail2">
            SELECT  *
            FROM   master2
            WHERE  SECONDCONN  >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_varchar">
            AND    SECONDCONN  <  <cfqueryparam value="#dateAdd('d', 1,form.enddate)#" cfsqltype="cf_sql_varchar">;
        </cfquery> 
        <cfchart format="flash"  chartwidth="1000" chartheight="500" scalefrom="0" scaleto="50000" xAxisTitle="Dates" yaxistitle="Number of Connections">
             <cfchartseries  query="detail1" type="line" itemColumn="FIRSTCONN" valueColumn="FIRSTOccurances" >
             <cfchartseries  query="detail2" type="line" itemColumn="SECONDCONN" valueColumn="SECONDOccurances" >
             </cfchartseries>
        </cfchart>
    The cfform code I'm using is as follows:
    <cfform format="flash" preloader ="false">
    <cfformgroup type="horizontal">
      <cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#form.startdate#">
      <cfinput type="dateField" name="enddate" label="End Date" width="100" value="#form.enddate#">
      <cfinput name="submitApply" type="submit" value = "Apply">
      <cfinput name="cancel" type="submit" value="Download CSV">
    </cfformgroup>
    Desired Output:
    I have attached the image for the output below. Please find it attached.
    Basically, if a date range is 21June to 21 July. The output must be as shown in the image. (I have omitted THIRDCONN etc for the sake of simplicity in my code).
    Please let me know how should I go about this problem and let me know if I can answer more questions.

    It's not built into the language. Your best bet is probably to put the CSV-Reading logic into its own class.
    Or find one of the thousands of classes that already implement such a thing.

  • Upload Csv files with infopackages - Error 1

    Hello again,
    i'm trying to upload csv file into a infopackage with master data text but the sistem sends a error message "Error 1 uploading external data".
    Infopackage settings:
    source system: PC
    file type: data file
    csv file
    data separator ;
    ESC signal "
    a created a txt file with data separated with ; and later converted txt file into a csv file.
    can anybody help me pls?
    Thanks
    Silvia Marques

    Hi Silvia,
    If the fields are correct in the transfer structure (only 2 fields). Then check whether the field length and type has been defined correctly for both the fields.
    If thats not a problem then try to load only upto PSA.
    If you are using IDOC as your transfer method then go to the "details" tab of the monitor of the error request and see the details. It will give you the correct picture of the error.
    Bye
    Dinesh.

  • Issue when I upload CSV file for insert contact list on Cisco Attendant Console Advanced

    Hi Friends,
    I have error "Provided file is not valid CSV File" when I upload CSV file to Cisco Attendant Console Advanced system. I'm not sure what happen about my CSV. My purpose is insert contact list to system and create CSV base on documentation.
    Anyone have idea to solve this issue please kindly help me.
    Thanks

    You are right, whenever Cisco device boots, the IOS files gets loaded on the DRAM.
    But in this process, some temporary files are also generated which gets saved in the flash/Disk, that’s the only reason you got these error messages. It’s not recommended at all to have less space in the Flash than what is recommended on Cisco.com. I would say please remove some files from Disk and have minimum 256 MB flash otherwise your router may drop into rommon mode at the time of next reload.
    Well, it’s good to upgrade the bootstarp image too. Currently you are running 15.X IOS code, I would say run 15.X bootstarp image on the box.
    You may download bootstarp image for 7206VRX NPEG2 from the link below:-
    http://software.cisco.com/download/release.html?mdfid=282188585&flowid=1380&softwareid=280805685&release=15.2.4S4&relind=AVAILABLE&rellifecycle=ED&reltype=latest
    If you want to know the procedure of the upgrade, click the link mentioned below:-
    http://www.cisco.com/en/US/docs/ios/12_2/configfun/command/reference/frf010.html#wp1017654
    -Amant

  • Upload csv file to server database directory through Apex interface

    Hi All,
    I have created a file browse item in Apex Page. through which user should be able to upload the csv file to database directory located in server.
    I have created one directory object in my schema say NAN_DIR where mentioned the directory.
    Need urgent solution......
    Thanks in Advance
    Danalaxmi

    Hi Danalaxmi,
    There is an example in this thread:
    Re: Store \ Retrieve files from file system
    Regards,
    Benz

  • Uploading csv file with number type data to database using apex

    hi
    am trying to upload csv file to oracle database using apex when i select the file using file browser and click on the button.
    my table looks like
    coloumn type
    col1 number(2)
    col2 number(2)
    col3 number(2)
    col4 number(2)
    please tell me the steps i need to follow
    urgent requirement

    This thread should help - Load CSV file into a table when a button is clicked by the user

  • In iWeb I created a hyperlink to a file on my computer. When I publish I get a 404 error for the link.  Can anyone help?

    In iWeb I created a hyperlink to a file on my computer. When I publish I get a 404 error for the link.  Can anyone help?

    How would I check to see if the like works when I enable via the inspector pane
    If you enable hyperlinks when you click on the link link to the pdf file it will open a browser window and display the pdf file.
    I upload the pdf files to the server and link to them as if they were an external web page:
    That's been more reliable for me than linking to the file as Link To: A file and have iWeb upload the pdf file to the serve.

  • How can we a validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    How can we a  validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    Please see:
    http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis
    http://social.msdn.microsoft.com/Forums/en-US/01ce7e4b-5a33-454b-8056-d48341da5eb2/vb-script-to-write-variables-to-text-file

  • Hi, I am getting an 'Error 4810 occurred at Sound File Read Open.vi' for the attached wav file (plus many other wav files). Any ideas?

    Hi,
    I am getting an 'Error 4810 occurred at Sound File Read Open.vi' for the attached wav file (plus many other wav files).
    Any ideas?

    No attachment exists.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    Did you reinstall CS3 after CC?
    For that matter, doing an in-place upgrade on the OS is always a gamble with Adobe programs. Reinstalling all the versions you need, in order, would probably solve your problem.
    And you shouldn't need to save as IDML after opening the .inx in CC.

  • Fixing duplicate database entries for the same audio file

    My iTunes Media folder is stored on a network accessible storage server. Since upgrading to 11.1.x, my computer seems to be duplicating database entries for the same audio files - for some albums, I have 4 entries for every song, each one pointing to the exact same file. The only difference between entries is rating info and play counts, which are specific to a particular entry (I think). Has anyone else seen this behavior? Is there an obvious way to stop this from happening? I can delete and rebuild the database from media files, but that starts getting old if I have to do it every week or so. Is there a script to delete duplicate database entries? (I found a VB script on the iTunes for Windows community, but the offending machine is a Mac).
    Thank you for any assistance!
    K

      Select the photo stack under the People tab and click the rename icon (bottom left)

  • Uploading CSV file problem

    Hello everyone.
    I have a minor problem in uploading CSV file to HTMLDB.
    I don't know the exact reason, but HTMLDB threw
    "ORA-20001: Unable to create collection: ORA-06502: PL/SQL: numeric or value error" whenever I tried to upload my csv file. after a few repetition of deleting potential problem-causing columns and trying again, I found out the following:
    when numeric value and character value are stored together in single column, the upload fails. For example, we have a column which stores the employee number. The employee number is just a sequential numeric value, however temporary employees have 'T' in front of their employee number, so it begins something like T0032 and so on.
    So, then, I tried to enclose all the employee numbers which start with numeric value with " character, but that would just simply take too long to do it manually, and excel does not seem to support enclosing the values with " when it's saving the spreadsheet with CSV format.
    So, I'm kind of stuck right now.
    Can anyone give me a good way to deal it?
    THANK YOU!

    Thanks for updating my forum setting, my name is now clearly visible :-)
    anyway.. I went back and tested couple of things...
    It now appears that the problem is not caused from values inside the column... instead..
    I believe the size of csv file with certain character set is the issue here...
    This is a rough estimate, but file size larger than about 31.7 ~ 9kb caused errors IF THEY CONTAINED OTHER CHARACTER SET THAN ENGLISH.
    here are informations about my setting:
    1. Oracle database: initially 9.2.0.1 -> patched upgrade to 9.2.0.4
    2. HTMLDB: 1.4.0.00.21c (downloaded from otn)
    3. db character set : UTF-8
    4. OS: windows 2000 (with up-todate service pack and
    security patches and etc..)
    5. system: toshiba tecra 2100 with 1GB ram and 40GB hdd
    6. operation system locale: korean, south korea
    I tried uploading many other files in both english and korean, which is my national language. The english csv file worked beautifully, without any file size limitations. However, when I tried to upload a file with
    KOREAN characters in it, it failed.
    Intrigued by this behavior I started to test the file upload with various excel files, and found out that..
    1. english csv files caused absolutely no errors.
    2. engilsh file with single korean character immediately
    threw the error, if the size exceeded 31.8kb (or I
    think the size is 32kb)
    3. I tested korean file mixed english file, caused
    the same error if the size exceeded 32kb.
    the distribution of korean characters inside the
    csv file did not matter, just don't go beyond 32kb!
    Please reproduce this behavior (but I presume that some efforts will be required in order to reproduce this error perfectly, since it is not easy to obtain foreign OS in US regions.. is it?)
    anyway, thanks for your quick reply, and
    I hope this problem gets fixed, because in this manner,
    I have to split my file into 32kb chunks!
    - Howard

  • Upload .txt file into Database Table

    Hi,
    I was wondering if someone could please point me in the right direction. I've been looking around the forum but can't find anything to help me achieve the following.
    I would like to be able to upload a .txt file using a webpage. Then store the information inside this file into database tables.
    eg. contents of mytextfile.txt:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    joe
    9 somestreet, elsewhere
    999 888 777 666
    peter
    214 nearby lane, overhere
    555 555 555 555
    I would like to insert this data into a table.
    eg. table name = CONTACTS
    userid = primary key (using sequence)
    username = (line 1 - richard, joe, peter)
    address = (line 2)
    phone_no = (line 3)
    As you can see the records will appear 1 at a time and will have a blank line between records. Is there anyway for me to upload a file like this and have it placed into tables?
    I have seen http://otn.oracle.com/products/database/htmldb/howtos/howto_file_upload.html but this seems to be for uploading a whole file and downloading the same file, rather than extracting data from the file.
    I hope I have managed to explain my problem.
    Many thanks,
    Richard.

    Richard,
    HTML DB allows you to upload CSV files via the Data Workshop. That data would then be parsed and inserted into a specific table. Alternatively, if you have your data in an Excel spreadsheet, and it is less than 32k, you can copy & paste the data directly into HTML DB's Data Workshop, which will then parse and import it into the Oracle database.
    The one obstacle you may have to overcome is converting your data from the format you outlined to CSV format. Specifically, you would have to make this:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    Look something like this:
    "richard","10 anywhere street, anytown, somewhere","111 222 333 444"
    Hope this helps,
    - Scott -

Maybe you are looking for

  • Safari 2.0.1 Crashes on Start-up but is Localized.

    Hello, Safari quits everytime on start-up but I created a test user account and it didnt quit so it seems to be a localized problem. It was working fine even after updating to 2.0.1. I went away for a couple days and when I got back and fired up the

  • Material Document in MIGO

    Hello, I processed a good receipt on MIGO with mvt code 101. I use MIGO transaction code, but when I display the material document in MIGO, in Doc Info, SAP shows that Transaction code MIGO_GR has been used. Is there a way to make SAP show the transa

  • Getting started with 8i

    I installed 8i personal edition for Windows 98 as a way to learn Oracle, using the 8i fir Dummies book. But apparently, I'm too much of a dummy even for that. It seems that I have to open database before going to SQL or anything. And Oracle wants a p

  • PERSON NOT VISIBLE IN OM IN STAFF ASSIGNMENTS DISPLAY

    hi all in OM First i uploaded org units through bdc next positons through bdc next jobs through bdc next s-o-c relationships in PA i uploaded employee master data (i.e. for IT0000, 0001 & 0002) while uploading 0001 i have assigned positions to the pe

  • How to handle Queue blockage due to application error in BPM

    Hi In the integration process that i have created, there is a SyncSend(calling a webservice using SOAP adapter) Step. Sometimes the response message from the receiver application may be a Fault message. Whenever a fault message is sent back to integr