How to insert apex_application_files file content into another table?

Hi All,
I am using Apex 3.2 on Oracle 10g.
I have used 'file_browse' item to upload a spreadsheet file into apex_application_files table.
I would like to populate another table with the contents of this spreadsheet file from apex_application_files.
I have spent almost 2 days looking for an answer on how to do this.
Can you please tell me how to do this or point me to a good resource?
Thank you,
Naushad.

Hi Thanks,
I did see this code, but this is not what I was looking for. This code simply inserts the file into another table, but I was looking for the contents of this file (eg. a single column spreadsheet with 10 lines and all ten of these lines to be inserted as rows in a table) inserted as rows into another table.
I managed to implement this by following below link:
http://nzchaudhry.wordpress.com/2011/07/18/uploading-csv-using-oracle-application-express-apex/
Thanks to all of you.
Naushad.

Similar Messages

  • Function module for transfering a file contents into another?

    Hi all,
       Is there a Function module for transfering a file contents into another?That is the whole content from a file to other??
    Regards,
    Shashank.

    Hi,
    I think there is no such FM. You need to read the data in internal table and then write it in another file.
    Regards,
    Atish

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • How to insert a pages document into another pages document?

    How can I insert a pages document into another one?
    How can I insert 1 page of a document into another document?

    Open your files & show thumbnails. Sections have a yellow border around all of the pages in that section. Now click on the page in the thumbnail pane & copy. If the file is more than one page & you only want one, you'll need to insert a section break to separate the pages. Then go to your other file, click in the thumbnail pane & paste. The whole copied page will be pasted in. Repeat with another section. Styles will copy over with the sections but headers & footers will not.

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
    Thanks in Advance.

    Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
    SQL> var v_id number
    update tableA  
    set colB='ABC' 
    where colC='XYZ' 
    returning id into :v_id;
    insert into table A_History (ID, colA, colB, ColC)  
    select id, ColA, ColB, ColC  
    from tableA  
    where id = :v_id;   

  • Reading file content into internal table

    Hi All,
    I'm facing problem reading pdf file content into an internal table. I need to read this file from communication server (neither presentation nor application server). I have tried gui_upload , it is working fine but it does not work in batch jobs. Open dataset in binary mode is also not helping much. Could anyone help ?
    Thanks a lot

    "open dataset <filepath> for input in binary mode" should work.... what does it say when you try this?
    Thanks
    Muktar

  • PS11 Organizer. how 2 move 1 file(folder) into another? drag & drop doesnt work...

    as it does in Win. also how can i create a new file/folder to put other files/folders into. ex a new folder names "Flowers" then put all the other files that contain flowers such as folder "red roses" into the "main" file of Flowers. Cant figure it out even using the book The Missing Manual. Thanks sara

    It sounds like this question is for Photoshop. This is a Flash forum. In any case, is your question about real folders on your computer, or server, or are asking about the files and folders in the "Layers" panel? Or, is your question about using the Library panel in Flash?

  • How to insert one XML document into another

    Hi,
    I've been working on a simple CMS.
    There is a main template that is just a HTML page. The main template has a few extra 'module' tags that indicates places where individual modules have to be placed.
    main template: template.xml
    <html>
    <body>
    <div>
    <module id="centre"/>
    </div>
    </body>
    </html>module template: module_centre.xml
    <div>
    <a>This is a MODULE and it may be much more complex</a>
    <div>My application has to detect every 'module' tag from the template.xml and insert there XML content from a proper module template.
    The result file has to be generated dynamically on a request. The structures of 'modules' can be only defined in module_*.xml files.
    The expected result
    <html>
      <body>
        <div>
            <div>
                <a>This is a MODULE and it may be much more complex</a>
            <div>
        </div>
      </body>
    </html>What's the best practice do solve this case?
    Pawel

    I think I've came up with a better solution.
    SRC file
    <?xml version="1.0" encoding="utf-8"?>
    <html>
      <head>
        <title></title>
        <style type="text/css">
    div.c4 {background-color:pink;width:400px;height:50px}
    div.c3 {background-color:green}
    div.c2 {background-color:blue;width:400px;height:299px}
    div.c1 {background-color:red}
    </style>
      </head>
      <body>
      <module id="XXX"/>
        <div id="main" class="c3">
          <div id="top" class="c1"><module id="menu_test"/></div>
          <div id="bottom" class="c2"><module id="menu_test2"/></div>
        </div>
        <div id="footer_container" class="c4">    <module id="menu_footer"/></div>
      </body>
    </html>MODULE src file
    <?xml version="1.0" encoding="UTF-8"?>
    <div id="admin_panel_module" style="background-color:orange;width:200px;height:50px">
        <p>Control Panel TEST</p>
    </div> @param source  -  NODES from MODULE document
    *@param target - TEMPLATE document where MODULES are going to be inserted*
    @throws Exception
    public static void insertModules(Node source, Document target) throws Exception {
    Node importedNodes = target.importNode(source, true);
    // Use XPath to find all 'module' nodes in ''
    XPath xpath = XPathFactory.newInstance().newXPath();
    NodeList nodes = (NodeList) xpath.evaluate("//module", target, XPathConstants.NODESET);
    // Remove MODULE node and insert there an XML content from MODULE template
    for (int idx = 0; idx < nodes.getLength(); idx++) {
    Node editedModuleElement = nodes.item(idx);
    // parent of module mode
    Node parentNode = editedModuleElement.getParentNode();
    // replace <module/> node with imported nodes from 'module' XML document
    parentNode.replaceChild(importedNodes, editedModuleElement);
    // nodes.item(idx).appendChild(node);
    importedNodes = target.importNode(source, true);
    }Edited by: maestr0 on May 24, 2010 12:44 AM

  • I had run a  query  I want to insert that query result into another table how it is please suggest me

    1
    1
    EC101
    P
    15
    P
    40
    2010-11-01
    1
    2
    1
    EC102
    P
    10
    P
    30
    2010-11-01
    1
    3
    1
    EC103
    P
    8
    P
    50
    2010-11-01
    1
    4
    1
    EC104
    P
    5
    P
    25
    2010-11-01
    1
    5
    1
    EC105
    P
    10
    P
    40
    2010-11-01
    1
    6
    1
    EC106
    P
    12
    P
    45
    2010-11-01
    1
    7
    2
    EC101
    P
    20
    P
    50
    2010-11-01
    1
    8
    2
    EC102
    P
    15
    P
    60
    2010-11-01
    1
    9
    2
    EC103
    P
    20
    P
    80
    2010-11-01
    1
    10
    2
    EC104
    P
    14
    P
    46
    2010-11-01
    1
    11
    2
    EC105
    P
    18
    P
    74
    2010-11-01
    1
    12
    2
    EC106
    P
    16
    P
    68
    2010-11-01
    1
    13
    3
    EC101
    P
    10
    P
    40
    2010-11-01
    1
    14
    3
    EC102
    P
    20
    P
    60
    2010-11-01
    1
    15
    3
    EC103
    P
    12
    P
    40
    2010-11-01
    1
    16
    3
    EC104
    P
    20
    P
    50
    2010-11-01
    1
    17
    3
    EC105
    P
    12
    P
    40
    2010-11-01
    1
    18
    3
    EC106
    P
    14
    P
    60
    2010-11-01
    1
    19
    4
    EC101
    P
    10
    P
    30
    2010-11-01
    1
    20
    4
    EC102
    P
    14
    P
    40
    2010-11-01
    1
    21
    4
    EC103
    P
    12
    P
    50
    2010-11-01
    1
    22
    4
    EC104
    P
    8
    P
    46
    2010-11-01
    1
    23
    4
    EC105
    P
    4
    P
    25
    2010-11-01
    1
    24
    4
    EC106
    P
    16
    P
    68
    2010-11-01
    1
    25
    1
    EC201
    P
    10
    P
    42
    2011-04-01
    2
    26
    1
    EC202
    P
    18
    P
    60
    2011-04-01
    2
    27
    1
    EC203
    P
    8
    P
    50
    2011-04-01
    2
    28
    1
    EC204
    P
    10
    P
    40
    2011-04-01
    2
    29
    1
    EC205
    P
    8
    P
    30
    2011-04-01
    2
    30
    1
    EC206
    P
    20
    P
    50
    2011-04-01
    2
    31
    2
    EC201
    P
    10
    P
    40
    2011-04-01
    2
    32
    2
    EC202
    P
    12
    P
    45
    2011-04-01
    2
    33
    2
    EC203
    P
    12
    P
    46
    2011-04-01
    2
    34
    2
    EC204
    P
    20
    P
    40
    2011-04-01
    2
    35
    2
    EC205
    P
    10
    P
    40
    2011-04-01
    2
    36
    2
    EC206
    P
    10
    P
    48
    2011-04-01
    2
    37
    3
    EC201
    P
    20
    P
    60
    2011-04-01
    2
    38
    3
    EC202
    P
    18
    P
    70
    2011-04-01
    2
    39
    3
    EC203
    P
    15
    P
    80
    2011-04-01
    2
    40
    3
    EC204
    P
    18
    P
    78
    2011-04-01
    2
    41
    3
    EC205
    P
    16
    P
    65
    2011-04-01
    2
    42
    3
    EC206
    P
    10
    P
    30
    2011-04-01
    2
    43
    4
    EC201
    P
    20
    P
    50
    2011-04-01
    2
    44
    4
    EC202
    P
    14
    P
    10
    2011-04-01
    2
    45
    4
    EC203
    P
    15
    P
    40
    2011-04-01
    2
    46
    4
    EC204
    P
    20
    P
    46
    2011-04-01
    2
    47
    4
    EC205
    P
    10
    P
    50
    2011-04-01
    2
    48
    4
    EC206
    P
    8
    P
    40
    2011-04-01
    2
    from this table I want take the semester wise result and after  that I want to take that result into new table  and I want take the rank also
    how

    Hey,
    Just perform an INSERT AS SELECT and don't forget to add APPEND hint. Also, you can do it using parallelism so before that just enable DML parallel for the IAS. Below are the commands:
    SQL> ALTER SESSION ENABLE PARALLEL DML;
    SQL> INSERT /*+ APPEND */ INTO NEW_TABLE (SELECT * FROM TABLE_QUERY);
    Regards.
    caadecarvalho

  • How to move milion of records into another table

    Hello, I would like to know if there is some way how to move large number of rows from one table into another.
    We have several tables storing runtime data. Data older then e.g. 10 days are moved into hitory tables. Currently we do this via pl/sql, but I was wondering if it is possible to do this somehow in SQL only (to make it faster).
    It is not possible to simply rename the tables, we need to move the data.
    Thanks for ideas.

    872553 wrote:
    Hello, I would like to know if there is some way how to move large number of rows from one table into another.
    We have several tables storing runtime data. Data older then e.g. 10 days are moved into hitory tables. Currently we do this via pl/sql, but I was wondering if it is possible to do this somehow in SQL only (to make it faster).
    It is not possible to simply rename the tables, we need to move the data.
    Thanks for ideas.To me looks like a Regular scheduled activity.
    Hence, using DBMS_SCHEDULER should be helpful.
    Create a Procedure to Copy the records from Transaction Table to History Table.
    create or replace procedure copyTransactionToHistory
    is
    begin
      insert /*+ append */ into history_table
      select column_list
        from transaction_table
       where transaction_date = trunc(sysdate) - 10;
      commit;
    end;
    Use DBMS_SCHEDULER to create Job with specified Time Interval (10 Days in your situation). More information and Examples are provided <a href="http://docs.oracle.com/cd/B28359_01/server.111/b28310/schedadmin006.htm#i1009099">Here</a>.There is also a possibilty of using NOLOGGING, but that will be recommended if the activity is not a regular scheduled activity and I do not think it would be a wise option to change the Table mode from LOGGING to NOLOGGING and vice-versa frequently.
    You might also consider options to improve the Data movement.
    1. Disabling Indexes/Constraints, if any, on History table.
    2. Using PARALLEL DML's option
    However, important information viz. your Oracle Version (Output of SELECT * FROM V$VERSION), Number of Records etc. are not mentioned which leaves us with no choice but to assume and suggest what we feel is best.
    Please read and post the information accordingly for us to help you. {message:id=9360002}

  • How to insert large xml data into database tables.

    Hi all,
    iam new to xml. i want to insert data in xml file to my database tables.but the xml file size is very large. performance is also one of the issue. can anybody please tell me the procedure to take xml file from the server and insert into my database tables.
    Thanks in advance

    Unfortunately posting very generic questions like this in the forum tends not to be very productive for you, me or the other people who read the forum. It really helps everyone if you take a little time to review existing posts and their answers before starting new threads which replicate subjects that have already been discussed extensively in previous threads. This allows you to ask more sensible questions (eg, I'm using this approach and encountering this problem) rather than extremely generic questions that you can answer yourself by spending a little time reviewing existings posts or using the forum's search feature.
    Also in future your might want to try being a little more specific before posting questions
    Eg Define "very large". I know of customers who thing very large is 100K, and customers who think 4G is medium. I cannot tell from your post what size your files are.
    What is the content of the file. Is it going to be loaded into a single record, or a a single table, or will it need to be loaded into multiple records in a single table or multiple records in multiple tables ?
    Do you really need to load the data into exsiting relational tables or could your application work with relational views of the XML Content.
    Finally which release of the database are you working with.
    Define performance. Is it reasonable to expect to process this kind of document on this machine (Make, memory, #number of CPUs, CPU Speed, number of discs) in this period of time.
    WRT to your original question. If you take a few minutes to search this forum you will find a very large number of threads with very similar titles to yours. These theads document a number of different approaches that can be used to solve this problem.
    I suggest you start by looking for threads that cover topics like DBMS_XMLSTORE, XMLTable(), Relational Views of XML content, loading XML content in relational tables.

  • How to insert a file in to the table.

    hi all,
    i'm new to lob types. my requirement is to store a document or excel spreadsheet or image to a single column and will be known at run time.
    i'm using java and oracle xe.
    1. lob has 4 types (blob, clob, nlob and bfile). which one will be best for my requirement.
    2. i have read some examples about clob and bfile. in all the examples, we need to create a directory and with the help of that directory, we need to insert the file.
    but, my doubt is, is it necessary to copy the file in that location, before inserting the file. and if not how i can give the file path to that one.
    its really helpful for me if u given the code or an example.
    regards
    pavan.

    hi pavan
    i am not very fimilar with lob's
    but i read one article in forms i hope it will help u
    http://www.oracle-base.com/articles/8i/ImportBlob.php
    Mohammadi

  • How to insert wifi scan data into sql table

    Urgent assist required. Can someone help pls, i have scanned wifi data in C# that i have split into required format MAC,SSID and RSSi . I want when i push a button the results are inserted into an sql table that i already created. and if i push the buton
    again it stops inserting. I have tried several methods and could not get it to work, Will appreciate assist
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Data.SqlClient;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.IO.Ports;
    namespace WICED_SERIALPORT_TEST
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void button1_Click(object sender, EventArgs e)
                string[] ports = SerialPort.GetPortNames();
                foreach (string port in ports)
                    comboBox1.Items.Add(port);
            string t;
            private void button2_Click(object sender, EventArgs e)
                t = comboBox1.Text.ToString();
                sErial(t);
            SerialPort sp;
            void sErial(string Port_name)
                sp = new SerialPort(Port_name, 115200, Parity.None, 8, StopBits.One);
                sp.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
                sp.Open();
            private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
                SerialPort sp = (SerialPort)sender;
                string msg = string.Empty;
                bool canCont = false;
                while (!canCont)
                    msg += sp.ReadLine();
                    if (msg.Contains("Scan complete "))
                        canCont = true;
                //string w = sp.ReadLine();
                //string w = sp.ReadExisting();
                // string msg = sp.ReadExisting();
                string[] msgArr = msg.Split('\r');
                Invoke(new Action(() => listBox1.Items.Clear()));
                List<string[]> list = new List<string[]>();
                List<Networks> Scan = new List<Networks>();
                for (int i = 0; i < msgArr.Length; i++)
                    list.Add(msgArr[i].Split(new string[] { "  " }, StringSplitOptions.RemoveEmptyEntries));
                for (int i = 0; i < list.Count; i++)
                    if (i > 2)
                        if (list[i].Length > 4)
                            int numOfSplits = 0;
                            List<string> tempList = new List<string>();
                            for (int ii = 0; ii < list[i].Length; ii++)
                                if (numOfSplits < 6)
                                    string[] temp1 = list[i][ii].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                                    numOfSplits += temp1.Length;
                                    for (int iii = 0; iii < temp1.Length; iii++)
                                        tempList.Add(temp1[iii]);
                                else
                                    tempList.Add(list[i][ii]);
                            Scan.Add(new Networks()
                                ID = Convert.ToInt32(tempList[0]),
                                NetworkType = tempList[1],
                                MAC = tempList[2],
                                RSSi = Convert.ToInt32(tempList[3]),
                                Rate = Convert.ToDouble(tempList[4]),
                                Channel = Convert.ToInt32(tempList[5]),
                                Security = tempList[6],
                                SSID = tempList[7],
                if (msg != String.Empty)
                    Invoke(new Action(() => richTextBox1.AppendText(msg)));
                for (int i = 0; i < Scan.Count; i++)
                    Invoke(new Action(() => listBox1.Items.Add(Scan[i].MAC)));
                    Invoke(new Action(() => listBox2.Items.Add(Scan[i].RSSi)));
                    Invoke(new Action(() => listBox3.Items.Add(Scan[i].SSID)));
                    msg = string.Empty;
                    list.Clear();
            private void richTextBox1_TextChanged(object sender, EventArgs e)
            private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
            private void richTextBox2_TextChanged(object sender, EventArgs e)
            private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
            private void Form1_Load(object sender, EventArgs e)
            public SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\AP_SCAN_DATA.mdf;Integrated Security=True");
            private void button3_Click(object sender, EventArgs e)
                using (SqlConnection connection = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\AP_SCAN_DATA.mdf;Integrated Security=True"))
        using (SqlCommand command = new SqlCommand())
            command.Connection = connection;            // <== lacking
            command.CommandType = CommandType.Text;
            command.CommandText = "INSERT into LOCATIONSCAN ((Scan[i].SSID),(Scan[i].MAC), (Scan[i].RSSi)) VALUES (@SSID, @MAC, @RSSi)";
            command.Parameters.AddWithValue("@SSID", listBox1);
            command.Parameters.AddWithValue("@MAC", listBox2);
            command.Parameters.AddWithValue("@RSSi",listBox3);
            try
                connection.Open();
                int recordsAffected = command.ExecuteNonQuery();
            catch(SqlException)
                // error here
            finally
                connection.Close();

    Hello,
    Remove the Try-Catch as this hides any errors that may be raised. It is unwise to use a Try-Catch this way, always when using a Try-Catch write code that alerts or writes to a log file. Also, there is no need for invoke Close method for the connection object,
    the Using statement closes the connection for you.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • HELP! How to insert long delimited text into a table

    Friends,
    I have an Oracle table with a long field containing comma delimited text.
    Table Def:
    QUOTE_LINES
    (quote_no VARCHAR2(20),
    quote_data LONG)
    Example data from quote_data field:
    A='750 Gallon',B='1250',C='300HP',D='Transmission',E=TRUE,F='Top Mount',G='Full Height',H='Full Height'
    Note: There are no <CR> in the data.
    I want to create a trigger on the table that loads the data into a separate table like this:
    quote_no VARCHAR2(20),
    line_type VARCHAR2(50),
    line_value VARCHAR2(30)
    Any suggestions?
    Larry

    Hello
    Really, if at all possible you should look at converting the long column to a clob. This will get rid of lots of limitations and you will be able to treat the column just like a varchar2.
    Anyway, if you cannot change from a long for the mean time, you could use the following, as long as the length of the text in your long column doesn't exceed 32k (which by all accounts is pretty large!):
    SQL> create table dt_test_long (id number, big_text long);
    Table created.
    SQL> create or replace procedure dt_test_proc(an_id in dt_test_long.id%type)
      2  IS
      3
      4     lv_LongVal      VARCHAR2(32767);
      5
      6  BEGIN
      7
      8     SELECT
      9             big_text
    10     INTO
    11             lv_LongVal
    12     FROM
    13             dt_test_long
    14     WHERE
    15             id = an_id;
    16
    17     dbms_output.put_line(lv_LongVal);
    18
    19     --do whatever you want with the value here
    20
    21  END;
    22  /
    Procedure created.
    SQL> create or replace trigger dt_test_long_trg before insert on dt_test_long
      2  for each row
      3
      4  begin
      5
      6     dt_test_proc(:NEW.id);
      7  end;
      8  /
    Trigger created.
    SQL> set serveroutput on
    SQL> insert into dt_test_long values(1, 'Some text, some more text etc....');
    Some text, some more text etc....THT
    David

  • How to insert comma delimited values into a table

    I have a variable holding values like,
    'A,Ba,Ccc' OR
    '1,2,3,4'
    I want to know how to convert and insert these values in oracle table as seperate rows like,
    A
    Ba
    Ccc[ OR ]
    1
    2
    3
    4
    Thanks,
    Previn

    Answered (I guess) in this dbms_utility.comma_to_table.
    Cheers, the ever helpful APC

Maybe you are looking for

  • Simple animated gif question

    Hello all- When exporting an animated gif, the speed of the gif is slower than what I'm seeing in the export wizard or the original screen. The gif has 18 frames and is only 17 kb when exported, so not a big file. I've read everything I can find and

  • What is the tcode for bdc recording and how to do in hr-abap for pa and om

    hi,      I need to do the bdc recording for pa and om. So, can any of you tell me how to do and what are the tcodes we have to use. thanks & regards,     Sekhar.

  • Contract Generation question: Formatting, Numbering of clauses, variables

    Hi! I am trying to create a Contract Document Template (for Contract Generation) with Variables I created some Variable Collections, but when I link them to the Contract Template, they add on with a different formatting altogether, which is neither l

  • Memory leak in OracleDataReader with UDT in 11g

    Hi, Can someone confirm that the following code is leaking (hugely!): command = new OracleCommand("select c.polygon from spatial c", connection); reader = command.ExecuteReader(); while (reader.Read()) reader.Dispose(); command.Dispose(); where polyg

  • Virus in Motherboard?

    I have a computer that is just loaded with viruses and spyware due to leaving for a week and not having a password set to keep others off my computer. I tried reformatting the hard drive but the virus and other objects remained. I then tried a low le