How to insert a table data into temporary table

Hi
Can anyone help me to insert a table data into temporary table.
Thanks
Navin

If you could provide a (simplified) example of the data you have and the output you're attempting to get, that would probably be quite helpful. I'm not sure that I understand exactly what you're trying to do here...
1) It sounds like you know the structure of the result set you're trying to generate. So it would be possible to create a temporary table once (at the same time that you create all your other tables) and write procedural PL/SQL code that would step through the data, write data to the temp table, select the data out of the temp table, and return a REF CURSOR. That would tend not to be the way that an Oracle developer would do things (there are exceptions, of course), but it would work.
2) I don't see any inherent problems in using sub-selects and inline views to do whatever aggregation you're trying to do on the secondary tables, which would allow you to get the output in a single query. For example, given an ORDERS table and an ORDER_DETAILS table,
SELECT o.customer_id, o.invoice_number, SUM( od.line_item_cost ) total_cost
  FROM orders o,
       order_details od
WHERE o.order_id = od.order_id
GROUP BY o.customer_id, o.invoice_number3) If you do need to use procedural logic, I would tend to look into the use of pipelined table functions or to read the data into an in-memory collection and to manipulate and return that collection.
Justin

Similar Messages

  • 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 3D Model data into an EPUB file?

    Afternoon,
    I am trying to insert a 3D model into an epub document. Does anybody know how to do this either within InDesign or with any other Adobe Program? The model I have is a Sketchup model and any export file type I try cannot be opened directly within InDesign.
    In terms of working with an EPUB file Mac had the ibooks Author software which lets you insert Collada data and view a 3D Model within an ebook however this only lets me maintain my file as a ibook but in terms of the business I need to maintain EPUB compatibility as they are more uniformly compatible across our clientèle.
    Can anyone shed some light on how to achieve the output I require?
    Spoke to adobe support and they expressed about using 3rd party external coders to achieve this but i know very little about code unfortunately.
    Regards,
    G

    InDesign doesn't natively support placing 3D models. It would have to be done with coding. If you can't do the coding yourself, you may have to pay for the service from an EPUB coding expert. You could also investigate third party EPUB software to see if they support it. Here is a recently-mentioned example (I don't know if they support it):
    http://iampariah.com/blog/creative-pro/fill-indesigns-fixed-layout-epub-gaps-with-circular flo.php

  • How to insert XML/dtd data into oracle db

    Hi,
    I have posted this question on couple
    sites and unfortunately I haven't received
    any response. Hopefully this time,
    someone can at least direct me to the
    website/document/sample codes which can provide me solutions of my question.
    My question is:
    Given a DTD, can the XML SQL Utility generate
    the database schema?
    I am trying to find out how the XML data can
    be loaded into the oracle database.
    Thanks in advance,
    Judy
    null

    A DTD does not contain enough information to do a good job at creating a database schema. It contains no datatype information, no field length information for starters, so a table created by a hypothetical DTD->to->Tables utility would be at best able to create a table with all VARCHAR2(4000) columns. Not that useful.
    My book contains lots of examples of techniques for loading XML data into Oracle, include lots of sample code and a whole chapter devoted to building a flexible "XMLLoader" utility for loading XML of arbitrary size into the database.
    Steve Muench
    Development Lead, Oracle XSQL Pages Framework
    Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
    Author, Building Oracle XML Applications
    null

  • 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.

  • JTable: HOW TO INSERT ROWS AND DATA?

    I have one JFrame on screen and inside of this i have a JTable, the question is how to insert rows and data into the JTable?

    [http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
    In future, please post Swing questions to the [Swing Forum.|http://forums.sun.com/forum.jspa?forumID=57]
    In short, your TableModel is probably a DefaultTableModel . Study its API.

  • How to insert one table data into multiple tables by using procedure?

    How to insert one table data into multiple tables by using procedure?

    Below is the simple procedure. Try the below
    CREATE OR REPLACE PROCEDURE test_proc
    AS
    BEGIN
    INSERT ALL
      INTO emp_test1
      INTO emp_test2
      SELECT * FROM emp;
    END;
    If you want more examples you can refer below link
    multi-table inserts in oracle 9i
    Message was edited by: 000000

  • How to load Matrix report data into basic table data using ODI

    Hi,
    How to load Matrix report data into basic table data using oracle Data Integrator ?
    Requirement Description:
    Following is the matrix report data:
    JOB                       DEPT10                DEPT20 
    ANALYST                                           6000
    CLERK                   1300                     1900 Need to convert it into below format:
    JOB                             Dept                        Salary
    ANALYST                  DEPT10     
    ANALYST                  DEPT20                     6000
    CLERK                       DEPT10                    1300
    CLERK                       DEPT20                    1900
        Thanks for your help in advance. Let me know if any further explanation is required.

    Your list seems to be a little restrictive, you can do a lot more with ODI procedures.
    If you create new procedure, and add a step. In the 'command on source' tab set you technology and schema as per your source database. Use the unpivot functionality as described in the link, please, rather than using 'SELECT *' use the appropriate column names and alias them for eg:
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    Then in your 'command on target' tab set the technology and schema to your target db, then put your INSERT statement for eg:
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    VALUES
    :job,
    :deptsal,
    :saledesc
    Therefore you are using bind variables from source to load data into target.
    Obviously if the source and target table are in the same database, then you can have it all in one statement in the 'command on target' as
    INSERT INTO job_sales
    (job,
    deptsal,
    saledesc
    SELECT job as job,
    deptsal as deptsal,
    saldesc as saledesc
    FROM pivoted_data
    UNPIVOT (
    deptsal --<-- unpivot_clause
    FOR saldesc --<-- unpivot_for_clause
    IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
    also set the log counter as 'Insert' on the tab where your INSERT statement is, so you know how many rows you insert into the table.
    Hope this helps.
    BUT remember that this feature only came out in Oracle 11g.

  • How to insert a gif file into a table?

    Hi,
    I need to insert a gif file into a table. Can anyone tell me where I can find the information on how to create this kind of table, how to insert a gif file into a table and how to select?
    Thanks,
    Helen

    Hi Helen,
    You could read about that in the documentation which is available online.
    For a starter: BLOB. And I bet there are many examples to be found on the web.
    Good luck. :)
    Regards,
    Guido

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • How do you make your data into a chart?

    How do you make your data into a chart?

    Dick,
    Your table should look like this:
    You're looking at 1 Header Row and 1 Header Column. Headers are shaded by default. Adding a shading to a regular column doesn't make it a header. Use the Table Inspector.
    When you Select the data and Insert a Table, you will get this:
    Got it?
    Jerry

  • How to  send ALV output data into Excel sheet format via Mail to the user?

    Hi friends,
    I have a doubt ie,
    How to  send ALV output data into Excel sheet format via Mail to the user?
    regards
    Moosa

    Hi,
    Provide the output internal table to the objbin in the below FM
    Send Message
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = i_docdata
                put_in_outbox              = c_x
           TABLES
                packing_list               = i_objpack
                object_header              = i_objhead
                contents_bin               = i_objbin
                contents_txt               = i_objtxt
                receivers                  = i_reclist
    and specify the document type
      i_objpack-doc_type   = 'XLS'.
    and try.
    Regards,
    Nandha

  • How to save the form data into adobe db?

    Hi All,
    How to save the form data into adobe db?
    I have designed one xdp file.
    Through processFormSubmission(), I got the submitted form data as Document obj.
    Then I have called the workflow kickoff program.
    code:
    InvocationRequest request = myFactory.createInvocationRequest ("myprocessname", //Specify the long-lived process name
    "invoke", //Specify the operation name
    params, //Specify input values (HashMap obj)
    false); //Create an asynchronous request
    It successfulyy started the workflow, but the submitted form data is not saved anywhere.
    And also, How get the form data from tables?
    Please provide the solution for the above.
    Thanks in advance.
    Regards,
    Saravanan G

    You need to create a process variable of type IN if you want to be able to pass data to your process. Then the params parameter (HashMap) contains a list of all the IN variables with their content that you want to pass to your process. They key is the name of the variable and the value the content. That way you should get it in your process.
    Now LiveCycle will create a column in the database for every process variable, so the content will be saved in the database just by creating that process variable.
    Jasmin

  • How to fetch single row data into multiple columns

    Hi Have a cursor
    which will have SELECT Sun_hrs,Mon_hrs,Tue_hrs,Wed_hrs,Thu_hrs,Fri_hrs,Sat_hrs from OTMaster;
    now my cursor has one row of the above columns with this row data I want to insert into other tale as column wise
    ex:
    my row is like this: Sun_hrs,Mon_hrs,Tue_hrs,Wed_hrs,Thu_hrs,Fri_hrs,Sat_hrs
    01:00 01:00 01:00 01:00 01:00 01:00 01:00
    now I want to insert the above data into table with loop along with weekday
    weekday, OTHrs
    1 01:00
    2 01:00
    3 01:00
    4 01:00
    5 01:00
    6 01:00
    7 01:00
    which type of variable I need to fetch the records, rowtype or tabletype,
    plz help me

    thank you for information, and now I am using UNPIVOT below is my query
    SELECT * FROM OTCEILINGMASTER
    UNPIVOT(OTHOURS FOR WEEK_DAY IN (SUN_CEILING_HRS AS '1',MON_CEILING_HRS AS '2',TUE_CEILING_HRS AS '3',
    WED_CEILING_HRS AS '4',THU_CEILING_HRS AS '5',FRI_CEILING_HRS AS '6',SAT_CEILING_HRS AS '7'));
    when I am selecting all the columns (select * from OTCEILINGMASTER) then only the above query is executing I want only two columns from the table however my table has 10 columns.
    please looking into this

  • How to Get the Current data into Planning Layout from the Planning cube

    Hi,
    I have a problem in BPS.   I am selecting the data from cube based on Month org details but I want to see the latest data.   How can i get this data into planning cube.
    Like
    data
    Tran           cal month            org               amt
    1                 jan                        a                  100
    1                 feb                        a                   200
    if i want to read based on Tran org as input values I shoud get the below data but I am getting the previous data.   
    Tran           cal month            org               amt
    1                 feb                        a                   200
    Kindly help me in this regard
    Thanks
    Naveen

    Naveen,
        Are yo having issue when you save something in the layout, the data doesn't appear in the listcube ? Or do you have issue that the latest data you see in the cube doesn't appear in the layout ?
    For the former issue, please look at your selections of listcube and for the second issue, please check your planning level definition, make sure all the restrictions you have applied are valid for this latest data to be presented in the layout.
    Hope this helps.
    Cheers
    Srini

Maybe you are looking for

  • How to resolve this RFC_adapter_sender to SOAP_adapter_receiver Exception?

    Hi all, I designed a RFC_adapter_sender to SOAP_adapter_receiver scenario. During runtime, I got com.sap.security.core.server.ws.service.WSSecurityException. I don't know the reason of this. The sender and the receiver is in two differen channels in

  • Why is Adobe Reader X deleting my PDF files when I try to burn to CD?

    I am using Adobe Reader X 10.0.1.  Within Windows Explorer I mark a pdf file for burning, then click burn at the top of the page.  Adobe tells me the file is missing.  Then when I check for the file, it is gone!  And not in the recycle bin either.  I

  • A problem with BIOS ??

    Hello, I have a HP pavilion dv3 and seems that my BIOS is down...when I turn on the PC, my screen just keeps flashing black and white...I tried to turn it on by pressing the windows key with B and power button what worked just once and then I turned

  • Asset number already exists in AS01

    Hi all, I am creating a new asset in AS01. The problem is that I am getting the error saying that the asset number already exists. Typically SAP continues on from the last old number, but now it is restarting from 30000. The number is being generated

  • Command line mail not working since Server 2.2

    Since Mountain Lion, everytime Server.app updates it borks my previous mail settings/hacks/workarounds to the issues with the last version. I just want sendmail, mail, postfix, etc to work and stay working. I even have my own list of stuff to reapply