Direct the output of query results to a table

Hi,
I would like to know as how to transfer the results of a query
to a table.
eg:
Select * from employee into <Tmp_table>
Hence I would have a copy of employee table in the newly created
Tmp_table.
Thanks in advance
Azeez

Oracle does this so well as:
create table <Tmp_table> as select * from employee
Hopefully I understood your question correctly.

Similar Messages

  • How to output a query results into a text file

    How to output a query results into a text file instead of outputing it to the screen..
    is there a way for us to write a SQL query which specifies to output the query results to a text file.
    Pls let me know how to do it
    Thanking u in advance
    regards
    Muraly

    Muraly,
    If you are using SQL*Plus 8.1.6 or later, you can also spool output to a file in HTML format, eg
    SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON
    SPOOL c:\temp\report.html
    SELECT DEPARTMENT_NAME, CITY
    FROM EMP_DETAILS_VIEW
    WHERE SALARY>12000;
    SPOOL OFF
    SET MARKUP HTML ENTMAP OFF
    In iSQL*Plus 9.0.1 (the browser-based interface to SQL*Plus) onwards, you can also send the HTML output to a new web browser window, or an html file -- much easier than the command line method.
    Alison

  • Howto: Save prediction query results to relational table

    I believe saving prediction query results to relational tables is possible (the BI studio does it!). I am not clear on how to do this w/o the BI studio, which means if I write a DMX query and want to store its output to a relational table, how do I do it?
    Tips, anyone?
    Thanks!

    a) You can write some code do this on the client-side. Use ADOMD.NET in your C# app to execute the DMX query and fetch a data reader, open up another connection to your relational database and write rows of data to the second connection as you read them from the first.
    b) You can create a linked server to your Analysis Server instance in your SQL Server relational server instance and then execute a "SELECT * INTO <newtable> FROM OPENQUERY(<linkedserver>, <DMX query>)" T-SQL statement from your relational database connection.

  • How to store query results into a table

    I want to store the query results to a table. Is there a way to automatically redirect output to a table without using a PL/SQL script.

    Run the following step only once unless you want to create the tabX everytime
    Create tabX as select x,y,z from tabY;
    Next time when you want to store the new results, run the following statement
    Insert into tabX select x,y,z from tabY;

  • How to pass query result to HTML table?

    Hi,
      i want to get the query result in HTMl table instead of Display Grid. how to do it? i searched in help, it suggests use icommand to do this. but i dont know how to pass the select query result to HTML table.. please help me.
    -senthil

    Hi Senthil,
    You can create an icommand query. You can then use the icommand retrieval methods to capture and manipulate the query data.
    (http://help.sap.com/saphelp_xmii115/helpdata/en/Applet_Reference_Details/iCom
    mand_Reference.htm)
    Basically what we did was, use the getColumnCount() and getRowCount() methods, once you have these two numbers you can set two for loops and use String getValue(int ColID, int RowID) , within the for loops you can generate the inner html content and write the values either in a html table or html form (which is what we did). This seems to work well, I'm still playing around with it and may post this approach on sdn by end of this week.
    Mahwish

  • How to estimate the size of query results

    i have 3 tables
    table_h : 10,000 records and 50columns
    table_l : 13,000 records and 75 columns
    table_ld : 25,000 records and 120 columns
    i wrote a query to fetch data based on the 3 tables, and fetching 25,00 records.
    ie ( 5 coulms from table_h, 12 coulmns from table_l and 120 columns from table_ld)
    how i have to get the size of this query results.

    What "size" are we talking about here? There are many different ways to interpret that-- it could be the size of the memory buffer that would be allocated on the client. It could be the size that would be required to store the result in a table in the database. It could be something else. But the answer may differ substantially.
    Regardless, it's probably going to be something like (number of rows) * (sum of sizes of each column). But the size required for each column is a bit variable
    - Client applications, in general, are going to allocate a memory buffer based on the maximum size of the column (LOB and LONG columns excepted). So if you declare a VARCHAR2(4000) but only store 1 byte in that column, most client applications are going to allocate 4k for that column for each row. It might be even worse than that-- if the client application happens to treat character data as Unicode, it probably uses the UTF-16 encoding in memory, which means allocating 2 bytes for every byte in the database (assuming the database character set supports single-byte characters primarily).
    - The Oracle database, on the other hand, is not going to allocate more disk than is actually required to encode variable width data. So the 1 byte column only requires 1 byte of storage (plus a length). That's great for storage efficiency, but that makes computing the actual size a bit more complicated because you now need to know the actual size of data stored in each row (or at least the statistical distribution) rather than the table definition.
    Justin

  • Can I re-direct the output of a UMI-7764 AO to another board (6233) AO?

    I have an existing application which I am trying to update to isolate
    the motor / encoder / servo amplifier from PC ground.  To this end
    I have installed opto-isolation circuitry and power isolation on the
    UMI-7764 to isolate my digital IO signals.  I still have a leakage
    path from the AO on the 7764 to the servo amplifier.  I do have a
    PCI-6233 in this setup, used for measuring isolated analog
    signals.  Is it possible to modify my labview control software to
    re-direct the AO from the 7764 to the 7233 AO to isolate the signal
    using the Configure Axes Resources.flx?  Otherwise a hardware
    route will need to be taken using an isolation amplifier (not
    preferred).
     Thanks in advance for any insight.
    -Stefan

    Hi Stefan,
    Unfortunately you will not be able to route the AO Ground through your 6233 if you are using our FlexMotion subVIs.  These VIs have been specially designed to work with our Motion Controller cards so will only communicate with them.  You mention using our UMI 7764, that is simply a breakout box, which motion controller card are you using?
    Also, what are you using to confirm that the AO Ground is 'leaking'?
    Rishi L
    National Instruments
    Applications Engineer

  • How to call a Java method n map the output of that method to a table in ODI

    Hi,
    I'm new to ODI. I've written an interface which joins two tables( in source ) to a file (in target). Now i have to apply a method(java call) on each element of a column in the target. Now my questions are :
    1. All that i know is to use Procedure using either Jython or Java BeanShell. Can you give some sample commands to achieve such functionality?
    2. Where should i actually apply this procedure? Is it possible to apply this procedure within the Interface during mapping (so that i can directly map the result to the output file)?
    Thanks in advance :)

    VikasKiran wrote:
    1. All that i know is to use Procedure using either Jython or Java BeanShell. Can you give some sample commands to achieve such functionality?Hi Vikash,
    Suppose the java code is like below
    import java.io.*;
    public class FileWrite
    public void writeFile()
    FileOutputStream fos;
    DataOutputStream dos;
    try {
    File file= new File("C:\\MyFile.txt");
    fos = new FileOutputStream(file);
    dos=new DataOutputStream(fos);
    dos.writeInt(2333);
    dos.writeChars("Hello World");
    } catch (IOException e) {
    e.printStackTrace();
    Next we compile the .java class from the command line and create the jar file.
    Then copy and paste the .jar archive to the ODI drivers folder. Next we restart the ODI agent.
    Now call methods in this class from either Jython
    import FileWrite
    fw=FileWrite()
    fw.writeFile()
    or from the Java BeanShell
    import FileWrite;
    FileWrite fw = new FileWrite();
    fw.writeFile();
    2. Where should i actually apply this procedure? Is it possible to apply this procedure within the Interface during mapping (so that i can directly map the result to the output file)?If your method is inside your jar file returning one value then store into one variable.Then use this variable in your interface or procedure wherever you want.
    As GURU told we cannot use procedure inside interface mapping.
    Thanks

  • Store SQL query results in db table

    Hi,
    I have a SQL query that produces a report table.
    Is it possible to automatically store the query results (or the report table) as a db table - without interrupting the current report building proces?
    Thanks,
    Dave
    Message was edited by:
    Dave Judge

    Hi Dave,
    You can also insert records into an existing table:
    INSERT INTO TABLEB (colA, colB, colC, etc) SELECT valA, valB, valC, etc FROM VIEWA WHERE etc etc
    This can be done during a page process that runs "Before Header" and you can base your report on the TABLEB. Obviously, you will need to maintain that table to ensure that it is only truncated where necessary, that one user doesn't try to access another user's data on that table and that each time your page is loaded it doesn't try to repopulate the table when you don't need it to.
    Another possiblity is to use a collection - which is user session based
    Andy

  • Query results to HTML table

    I'm looking for a more efficient way to convert a query result into an HTML table so that I can paste it into an email. The procedure in sqldeveloper (version 3.1.07) is just too clunky and involves too many keystrokes and mouse clicks. And you can't save the HTML to the clipboard. (I'm talking about the "Export..." action here.)
    Am I missing something? Are there any alternatives?
    Thanks!

    ... but sqlplus is so last millenium....
    Seriously? I'm from the last millennium too, nevertheless I don't consider myself out of date
    SQL*PLUS is still my first choice when I have to run a script. I'ts behaviour is reliably the same whereever my script is executed. I would never trust a script that needs another tool to be executed.
    Generating a HTML-mail is IMHO out of scope for a database tool. It's a feature I would expect in a BI tool that specializes on reporting.
    Regards
    Marcus

  • Create Internal table with fields coming as query result of multiple tables

    Hi
    I want to create internal table with the fileds which come as a result of a select query from multiple tables

    My code is something like this. I need  the data from various fields of diff tables depending on the excel file. This data is then to be put in a internal table
    *& Report  Z_EXTC
    report  z_extc.
    type-pools : abap.
    parameter: objname(25) type c.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    data: p_table type string.
    data:l_string type string,
         l_filename(200) type c,
         dy_line  type ref to data,
         xfc type lvc_s_fcat,
         ifc type lvc_t_fcat.
    types:begin of itab,
         tabname type dd03l-tabname,
         fieldname type dd03l-fieldname,
         end of itab.
    types:begin of atab,
          tabname type dd03l-tabname,
          cnt type string,
          end of atab.
    field-symbols: <dyn_table> type table,
                   <dyn_table1> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
          dy_table1 type ref to data.
    data: itab1 type itab occurs 0 with header line.
    data atab1 type atab occurs 0 with header line.
    data frstrec type i value 0.
    data lastrec type i value 0.
    l_string = ''.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'C:\excel_files\FIELDS_CC.TXT'
       filetype                      = 'TXT'
       has_field_separator           = 'X'       .
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    *Refresh itab1.
    loop at itab1.
      on change of: itab1-tabname.
        if lastrec = 1.
          move l_string to atab1-cnt.
       move itab1-tabname to atab1-tabname.
          append atab1.
          l_string = ''.
        endif.
        move itab1-tabname to atab1-tabname.
        frstrec = 1.
      endon.
      if frstrec = 1.
        concatenate l_string itab1-fieldname into l_string separated by
    space.
        lastrec = 1.
      endif.
    *write:/ itab1-tabname,40 itab1-fieldname.
    endloop.
    move l_string to atab1-cnt.
    append atab1.
    loop at atab1.
      write:/ atab1-tabname,5 atab1-cnt.
    endloop.

  • How merge query results from joined table into one additional column

    <code>
    Here is example
    TABLE A:
    id | value
    1 | a
    2 | a
    3 | b
    TABLE B
    id | id_in_table_a | value
    1 | 1 | d
    2 | 1 | e
    3 | 2 | g
    </code>
    this select should get all columns from table A where value = 'a' and all values related to this record from B merged to one column separated for example with pipe, so the output should looks like this
    <code>
    id | value | merged_column
    1 | a | d|e
    2 | a | g
    </code>
    thanks for help

    If you are on 10g, you can use this:
    SQL> create table a
      2  as
      3  select 1 id, 'a' value from dual union all
      4  select 2, 'a' from dual union all
      5  select 3, 'b' from dual
      6  /
    Tabel is aangemaakt.
    SQL> create table b
      2  as
      3  select 1 id, 1 id_in_table_a, 'd' value from dual union all
      4  select 2, 1, 'e' from dual union all
      5  select 3, 2, 'g' from dual
      6  /
    Tabel is aangemaakt.
    SQL> select id
      2       , value
      3       , rtrim(v,'|') merged_column
      4    from ( select id
      5                , value
      6                , v
      7                , rn
      8             from a
      9                , b
    10            where a.id = b.id_in_table_a
    11            model
    12                  partition by (a.id)
    13                  dimension by (row_number() over (partition by a.id order by b.id) rn)
    14                  measures (a.value, cast(b.value as varchar2(20)) v)
    15                  rules
    16                  ( v[any] order by rn desc = v[cv()] || '|' || v[cv()+1]
    17                  )
    18         )
    19   where rn = 1
    20  /
       ID VALUE MERGED_COLUMN
        1 a     d|e
        2 a     g
    2 rijen zijn geselecteerd.Regards,
    Rob.

  • Multiple BI Query Results into one Table

    Hi All
    Can I embed Multiple queries into one table using VC?
    I have data in different BI sources(Info Areas) like sales and distribution,Shipments etc. Can I write any universal query to retrive data from multiple sources?(If any???)

    Hi Jan Pasha,
    My model contains two BW queries which uses UNION and sent result to one table.
    I tried using UNION also but when I use it I am able to see no records to select in result table.
    I donot have any coloums in common. Is it pre-requisite for using UNION?

  • 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

  • Trouble outputting all query results

    For some reason this code doesn`t output all the results only
    the first one. How can I can it working I did try a way that output
    all the results the same amount of times as there are Referer
    entries in the db which is obviously not what I want. What is the
    way to do thisso that it is cfoutput right? Thank you very much
    <cfquery name="qrysales">
    SELECT Referer
    FROM clientinfo
    </cfquery>
    <cfoutput><cfif len(qrysales.Referer)>
    <cfif find("?", qrysales.Referer)>
    <cfset paramList = "q,p,terms,search,query,qkw">
    <cfset strStart = find("?", qrysales.Referer)>
    <cfset referer_queryString =
    right(Referer,len(qrysales.Referer)-strStart)>
    <cfset referer_url =
    left(qrysales.Referer,(strStart-1))>
    <cfloop list="#referer_queryString#" delimiters="&"
    index="i">
    <cfif listfind(paramList,listfirst(i,"="))>
    <cfset variables.searchPhrase = listlast(i,"=")>
    </cfif>
    </cfloop>
    </cfif>
    </cfif>
    <cfif isdefined("variables.searchPhrase")>
    <cfoutput>#variables.searchPhrase#</cfoutput>
    </cfif>
    </cfoutput>

    The code works fine using the querynew values. When I use the
    db cfquery then I get the results output over and over again. Why
    is that?! Thanks
    <!---
    <cfquery name="qrysales">
    SELECT Referer
    FROM clientinfo
    </cfquery>--->
    <h3>QueryNew Example</h3>
    <cfset qrysales = QueryNew("referer")>
    <!--- make some rows in the query --->
    <cfset newRow = QueryAddRow(qrysales, 4)>
    <!--- set the cells in the query --->
    <cfset temp = QuerySetCell(qrysales, "referer", "
    http://search.live.com/results.aspx?q=environment+property+study&FORM=SSRE2
    ", 1)>
    <cfset temp = QuerySetCell(qrysales, "referer", "
    http://search.live.com/results.aspx?q=healthcare&mrt=en-us&FORM=LIVSOP",
    2)>
    <cfset temp = QuerySetCell(qrysales, "referer", "
    http://www.google.co.uk/search?q=grande+rio&sourceid=navclient-ff&ie=UTF-8&rlz=1B2GGFB_enG B251",
    3)>
    <cfset temp = QuerySetCell(qrysales, "referer", "
    http://www.google.de/search?q=Rio-Grande&ndsp=20&hl=de&ie=UTF-8&oe=ISO-8859-1&start=30&sa= N",
    4)>
    <cfoutput query="qrysales"><cfif len(#Referer#)>
    <cfif find("?", #Referer#)>
    <cfset paramList = "q,p,terms,search,query,qkw">
    <cfset strStart = find("?", #Referer#)>
    <cfset referer_queryString =
    right(Referer,len(#Referer#)-strStart)>
    <cfset referer_url = left(#Referer#,(strStart-1))>
    <cfloop list="#referer_queryString#" delimiters="&"
    index="i">
    <cfif listfind(paramList,listfirst(i,"="))>
    <cfset variables.searchPhrase = listlast(i,"=")>
    </cfif>
    </cfloop>
    </cfif>
    </cfif>
    <cfif isdefined("variables.searchPhrase")>
    #variables.searchPhrase#
    </cfif>
    </cfoutput>

Maybe you are looking for