Download csv file into the database using apex

Hi all

I use apex 4 and express oracle 10g, I need to upload the .csv file in the database for one of my queries, I just discussion forum for solutions, I found too, but some how its does not work 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);
number of c_chunk_len: = 1;
v_line VARCHAR2 (32767): = NULL;
v_data_array wwv_flow_global.vc_arr2;
BEGIN
-Read data from wwv_flow_files
Select blob_content from v_blob_data
of wwv_flow_files where filename = "DDNEW.csv";

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
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: 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);
-Insert data into the 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);

-Remove
v_line: = NULL;
END IF;
END LOOP;
END;



what I understand of it's system does not identify v_data_array as table for some reasons, please help me.



initially the system was in error for hex_to_decimal, but I managed to get this feature on the discussion forum, and now it seems to be ok. but v_data_array problem is still there.



Thanks in advance

concerning

Uday

Hello

Correct errors in your sample, I have

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 have created table missing

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)
  );

Kind regards
Jari

Published by: jarola November 19, 2010 15:03

Tags: Database

Similar Questions

  • Download any file in the database column

    Hi all

    Is it possible that I can download any file in a column of data?

    I use oracle forms 6i and oracle database 10g.

    Kind regards

    Atif Zafar

    Dear Sir

    You can select the built-in file using GET_FILE_NAME. And then copy the file into the database using HOST Directory integrated (using the CMD). After you copy the file in the database directory, you can call the procedure of database to update the database file.

    Manu.

  • How to insert data into the database using smartview

    Hello
    I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
    My database is empty.

    I opened an ad hoc network, it returns * "#missing" * in all cells
    I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
    It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.

    I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?

    --
    VINET

    You go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Reading file and dump the data into the database using BPEL process

    I have to read the CSV file and insert data into the database... To do this, I created some asynchronous bpel process. Adapter filed added and associated with the receive activity... Adapter DB has added and associated with the Invoke activity. Receive two total activity are available in the process when trying to Test em, receive only the first activity is complete and awaits the second receive activity. Please suggest how to proceed with...

    Thanks, Maury.

    Hi Maury,

    There is no need in step 2 that u mentioned above. I donot find useless a webservice?

    The process will be launched by the CSV file, then using the processing activity, you can put it in the DB.

    There should be no way where you can manually test it by giving an entry. All you can do to test is to put the file in the folder you mentioned when configuring the file adapter.

    You just need to have the composite as below:

    ReadCSVFile---> BPEL--> DB adapter

    And in your BPEL process:

    Recieve--> Transformation activity--> call activity

    Try to work on some samples listed on the oracle site and go through the below URL:

    The playback of the file adapter feature using

    Thank you

    Deepak.

  • .txt or CSV file to the database

    Hi-

    I have a file of text generated by a Pulse Oximeter, what I want is, as the system is receiving the file (CSV .txt) he automaticly walked into a MySql or SQL Server database and generates an SMS message. Thank you

    Concerning

    Tayyab Hussain

    Web services involve using sychronous communication. However, the use case you describe means that asynchronous, the so-called fire-and-forget, communication is better suited to your needs.

    For example, with sychronous communication, the system ignores the exact moment where in a TXT or CSV file will come. Also, when the Treaty system a file, all the other treatments waits until the system ends. This can cause synchronization problems if multiple files enter the system in quick succession.

    ColdFusion is an asynchronous solution that fits the requirements of your use case. The following methods will allow you to receive the file to automatically enter data and generate an SMS message. Use the DirectoryWatcher gateway in ColdFusion to monitor the directory in which the TXT or CSV files are deleted and events of ColdFusion SMS gateway to send SMS messages.

    Whenever a third party files a file in the directory, an event is triggered, setting the DirectoryWatcher in action. Set up a query to the onAdd of listener of the DirectoryWatcher CFC method to store the file in the database.  Following the request, use the sendGatewayMessage method to send the SMS message.

  • Insert the record into the database using hyperlink

    My dev environment is DWCS3/MSAccess/ASP

    I have a pretty simple site where I want to enable connected users to save documents to a Favorites page (the ID of the page they are on). For aesthetic reasons, for the most part, I want to be able to click on a hyperlink for the kickoff of the insert and allows their right to return to the page they were on the behavior of the FORM action.

    Is this possible in ASP Classic? Does anyone have suggestions as to how I can do this?

    Thank you very much.

    Since my main goal was to avoid putting a button on the page, I used the kind of a workaround plan b. I've created a save"link" which leads to a "success" - style page where they then click on a button to continue. I had passed the form hidden as variables to this page then used values built in behavior record insert to write the record in the Database when they click on "continue". Not the thing I wanted to do initially, but it works.

  • CSV file upload to database page-Urgent OFA

    Hi all

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


    Thanks and greetings

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

    Kind regards
    Out Sharma

  • 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

  • APEX 5: FILE item type to BROWSE not load file into the table apex_application_temp_files

    Hello

    I am trying to load the BLOB (CSV file) into apex_application_temp_files table using the file_browse item type. I have created an example page and the added element of type file_browse, added a dynamic action, which send item to browse.

    Also added a button load that submits the page. But when I check the apex_application_temp_files of APEX sql workhop table, nothing appears.

    I purge file to "end of Session. Enclosed screen shot as well.Capture.PNG

    Thank you

    Ankit

    Hi Pierre,.

    has added a dynamic action, submitting travel item.

    How can you submit just the element go? How your dynamic action look like?

    But when I check the apex_application_temp_files of APEX sql workhop table, nothing appears.

    It is by design, because the sight of apex_application_temp_files limited to your current session. In your case at the session of constructor and not your application.

    Add a process to the page that contains the item "Browse file" when you use

    select *
      from apex_application_temp_files
     where name = :page item name;
    

    to access your downloaded BLOB.

    Concerning

    Patrick

  • Error importing CSV files with "hidden" characters using the external Table

    Hi people

    Bit of a strange here.

    Well, we are accustomed to the use of the external Table method to load data from CSV files in the database, but a recent event presented us a problem.

    We have received some CSV files that "look like" regular CSV files, but Oracle will not load them.

    When we looked at the CSV using VIM on a UNIX machine, we saw the following characters 'hidden' between each regular character in the file.
    ^@
    If a string that looks like this when opened in Excel/Wordpad etc.
    "TEST","TEXT"
    Looks like this when exmained with VIM
    ^@"^@T^@E^@S^@T^@"^@,^@"^@T^@E^@X^@T^@"
    Has anyone encountered this before?

    Thank you very much

    Simon Gadd
    Oracle 11g 11.2.0.1.0

    Hi Simon,.

    ^ @ represents the ZERO character (0x00).
    So, most likely, you have a file encoded in Unicode.

    You need to specify the character set in the record specification (and if necessary the byte order mark), for example:

    CREATE TABLE ext_table
    (
      col1 VARCHAR2(10),
      col2 VARCHAR2(10)
    )
    ORGANIZATION EXTERNAL
    (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY dump_dir
      ACCESS PARAMETERS
      (
       RECORDS DELIMITED BY '
    ' CHARACTERSET 'UTF16'
      FIELDS TERMINATED BY ','
      )
      LOCATION ('dump.csv')
    )
    REJECT LIMIT UNLIMITED;
    

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16536/et_params.htm#i1009499

  • Download the contents of the MS XL file in the database

    Hello

    I want to import the contents of the MS xls file into my database using the input file component... I use jdev 11.1.1.3.0

    Thanks in advance for your help.

    The inputFile would get only your file for middleware - then you need to write code to scan your XLS file and bring it into the DB.
    Search the POI library for utilities that can analyze XLS files.

  • A query when importing an XML file into a database Table

    Hello
    I create an ODI project to import an XML file into a database using the following link Table.With

    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/FMW/ODI/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
    I am facing a problem when creating physical Schema for the XML Source model.
    For the
    Schema (Schema)
    and
    Schema field (scheme of work) that they have chosen to GEO_D.
    What GEO_D here?
    or
    What should I select here?
    (1) the XML schema (NB:-J 'I havn' t created any file .dtd for my file .xml or .xsd)
    or
    (2) my diagram of target servers
    Please tell me what I do?
    Thank you

    and
    Schema field (scheme of work) that they have chosen to GEO_D.
    What GEO_D here?

    Is the schema specified in the XML file name.

    What should I select here?
    (1) the XML schema (NB:-J 'I havn' t created any file .dtd for my file .xml or .xsd)

    Yes

    (2) my diagram of target servers
    Please tell me what I do?
    Thank you

  • Cannot insert data into the database

    Hello world

    I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.

    Problem is use Labiew 8.2. So try to answer accordingly

    Try it with a cluster instead of a string or an array.

  • Inserting a new record in the database using a form empty ADF

    Hello

    I'm trying to insert a new record into the database using a form.

    I have an Employee table and its corresponding entity object and the view object. The table has an id that is used as the primary key and is filled using a sequence in the comic book.

    Data controls, I dragged and dropped at the sight of the employee as a form of ADF and checked the submit button include. Then I dragged and dropped the validation on submit button operation.

    When I connect to the app and go to the page used to create, I have 2 problems:
    1 - the form is filled with the logged in user info.
    2. If I try to change the news and validation, the user info is changed in the database and no new record is created.

    It makes a little sense to me, but I would like to know if there is a way around it (get an empty form and insert a new record).
    NB: the employee id is not part of the form, I want to be filled using the sequence.

    Kind regards
    MB

    User, please tell us your jdev version!

    To do this, you must create a new record before going to the display of the form page. In a stubborn workflow (btf), you drag the operation createInsert of the VO on the btf and it will generate a link method, add a view to the btf and put a navigation of the binding of the method of the page. Mark the method as 'Activity by default'. Now, ren, you call the workflow, you create a new record that will show your blank form.

    Timo

  • When I use the socks proxy in firefox, I can travel only and can not download any file from the internet.

    When I use the socks proxy in firefox, I can only navigate through internet and cannot download any file from the internet.

    I have no problem when using HTTP proxy servers and have no problem managing which connection to internet without proxy.

    I found this problem due to the integration of the browser evolved in the idm software, and when I turn this option off in idm problem will be solved

Maybe you are looking for