How to export data and the SQL sentence?

Hi all

I need to create sentences SQL INSERT INTO clauses of the data exported from a table in another table?

Thank you and best regards,

Carlos N.

Insertion of a line is both ineffective.
You can do it for the

SQL> select decode(rownum,1,'Insert all'||chr(13),'     ')||
  2  'into emp (empno,ename) values ('||empno||','''||ename||''')' from emp
  3  /

DECODE(ROWNUM,1,'INSERTALL'||CHR(13),'')||'INTOEMP(EMPNO,ENAME)VALUES('||EMPNO||','''||ENAME||''
------------------------------------------------------------------------------------------------
Insert all into emp (empno,ename) values (7369,'SMITH')
     into emp (empno,ename) values (7499,'ALLEN')
     into emp (empno,ename) values (7521,'WARD')
     into emp (empno,ename) values (7566,'JONES')
     into emp (empno,ename) values (7654,'MARTIN')
     into emp (empno,ename) values (7698,'BLAKE')
     into emp (empno,ename) values (7782,'CLARK')
     into emp (empno,ename) values (7788,'SCOTT')
     into emp (empno,ename) values (7839,'KING')
     into emp (empno,ename) values (7844,'TURNER')
     into emp (empno,ename) values (7876,'ADAMS')
     into emp (empno,ename) values (7900,'JAMES')
     into emp (empno,ename) values (7902,'FORD')
     into emp (empno,ename) values (7934,'MILLER')
select * from dual ; --- // Add this statement manually or in the script
-- // using prompt statement in sqlplus 

SS

Tags: Database

Similar Questions

  • How to export data from the table with the colouring of cells according to value.

    Hi all

    I use jdeveloper 11.1.1.6

    I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?

    You can find us apache POI-http://poi.apache.org/

    See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html

  • How to export data to excel that has 2 tables with the same number of columns and the column names?

    Hi everyone, yet once landed upward with a problem.

    After trying many things to myself, finally decided to post here...

    I created a form in form builder 6i in which clicking on a button, the data gets exported to the excel sheet.

    It works very well with a single table. The problem now is that I cannot do the same with 2 tables.

    Because the tables have the same number of columns and the columns names.

    Here are the 2 tables with column names:

    Table-1 (MONTHLY_PART_1) Table-2 (MONTHLY_PART_2)
    SL_NOSL_NO
    MODELMODEL
    END_DATEEND_DATE
    U-1U-1
    U-2U-2
    U-4U-4
    ..................
    ..................
    U-20U-20
    U-25U-25

    Given that the tables have the same column names, I get the following error :

    402 error at line 103, column 4

    required aliases in the SELECT list of the slider to avoid duplicate column names.

    So how to export data to excel that has 2 tables with the same number of columns and the column names?

    Should I paste the code? Should I publish this query in 'SQL and PL/SQL ' Forum?

    Help me with this please.

    Thank you.

    Wait a second... is this a kind of House of partitioning? Shouldn't it is a union of two tables instead a join?

    see you soon

  • How to load data from ms sql to the by the file rules and maxl essbase

    Hi, everybody!
    Pretty Shure the kind of topic exists already on the forum, but unfortunately can't find it.

    I want to understand, how to load data from the database to ms sql for the PB of essbase application.

    (I) so I have:
    1. a request for 'society '.
    2 and its database 'Plan '.
    3. with simple outline, which contains only two dimensions:

    -The time period < 1 > (Label only)
    -Total year (~)
    -Qtr1 (+)
    Jan (+)
    Feb (+)
    Mar (+)
    -Qtr2 (+)
    APR (+)
    May (+)
    Jun (+)

    -Accounts < 1 > (Label only)
    -Lost / based (~) (Label only)
    -Revenues (+)
    L1.1 (+)
    L1.2 (+)
    -Costs (-)
    L2.1 (+)
    L2.2 (+)

    (II) also, I created a rules file called "CO_DWH" and associated with this schema
    It (Rules file) a 3 columns:
    Data of the 'period', 'account '.

    There is also the option checked "load data".

    (III) in MS SQL Server, I have a database of "hypdb" and "essadmin" with "password" login

    (IV) I executed my bat file:
    C:\Hyperion\EssLoad.bat
    There is only one line:

    EssLoad.bat-
    startMaxl.cmd EssLoad.txt
    ----------------------------------------------

    EssLoad.txt-
    login password admin on erpserver;
    Import database data Company.Plan connect in essadmin password using the server rules_file 'CO_DWH' error abort;
    disconnection;
    "exit";
    --------------------------------------------


    All plans that I copied well worked ERP system, but I don't understand, this is exactly table in the MS SQL database, data loading to essbase db?

    TOU have to do a few things
    1. on the server of Essbase, put in place a system odbc for your MySQL database connection
    2. in the State of charge, go to the file menu and select open source SQL database and in the source of data in your SQL statement. A few tips. Where it says select, don't put in the select Word and when he says to not put in of. The system adds for you. TI enter a simple SQL statement is to do this in the box so select if your SQL would be normanlly as select * from myTable just enter the code as * from myTable in the upscale neighborhood

    The ol/recover the click and fill your connection information. Should bring back the data in the State of charge. Save the State of charge and use

  • How to find the next date of the year and day as of today's date and the day

    I have a question about date functions, that is to say: how to get one next year (date and day) like today are the date and the day this year?

    You mean like this?

    SQL > select to_char (add_months (sysdate, 12),' day DD/MM/YYYY ') twice;

    TO_CHAR (ADD_MONTHS (S
    --------------------
    Friday, August 22, 2014

  • How to erase data from the iphone if I lost and iphone is offline

    How to erase data from the iphone if I lost and iphone is offline

    < post branched out by host >

    Hello

    What to do if your iOS device is turned off or offline?

    If your missing device is turned off or offline, you can still implement this Mode lost, lockor remote wipe. The next time your device is online, these measures will take effect. If you remove the device from your account while it is offline, pending actions for the device will be cancelled.

    If your iPhone, iPad or iPod touch is lost or stolen - Apple supports

  • Safari, taken in charge by the fake site FBI and money required for release, I need to delete the history data and the web to regain access.  How do I block it?

    Safari, supported by the fake site of the FBI and the money requested release. I have to delete the history data and the web to regain control. How do I block it?

    Lean on an adblock app. I use Weblock but there are other

    And if there is a particular site that you are attending that flat to the top of these malicious ads, well stop to go.

  • How display the date and the time in the taskbar on Windows 7 Home Premium 64 bit system?

    How display the date and the time in the taskbar on Windows 7 Home Premium 64 bit system?

    I already did it.  The time is displayed in the correct format, but I can't seem to view the date of

    Any other suggestions?

    Thank you

  • Marshall plan: how to pass data between the main field and sub-application

    Hello

    I'm trying to load a Flex 3.5 application in Flex 4. In the process, I need to move a strong local typed object from main application to the loaded swf file. And I also have to pass a rope and a bitmap of application sub to the main application. Have an example to show how to pass data in the application domain?

    Thank you

    SW

    Define scaleContent = true, set a breakpoint on SWFLoader.as:doScaleContent and

    see if he thinks there's a swfBridge.

  • ODI - how to export data of "elimination" HFM?

    Hello

    I'm trying to export some data from HFM in SQL, using ODI table. It seems that ODI export data from the 'currency of the entity' as a default. Is it possible to export the value of "elimination" instead?

    If so, how can I do it?

    It is not the case. Only data can be exported with ODI. Elimination is regarded as aggregated data, and for this reason cannot be exported. Only level 0 data can be exported.

  • How to export data from user information in ACS 5.5?

    Hi all

    You can see the photo, how to export data from user information in ACS 5.5? Thank you!

    Sincerely yours

    Hello

    Yes you are right.

    Kind regards

    Aditya

    Please evaluate the useful messages and mark the correct answers.

  • How do I get all the SQL executed by my session?

    How do I get all the SQL executed by my session?

    Published by: user11300376 on 01/28/2013 11:27

    user11300376 wrote:
    I had tried, brings itself however only select table v $ session.

    Executed orders:

    SELECT * FROM MBS_ITEM;

    SELECT b.sql_id, b.sql_text
    SESSION $ v a, v$ sql b
    WHERE a.sql_id = b.sql_id;

    The output result:

    SQL_ID SQL_TEXT
    1 4qg3bft0w37rt SELECT b.sql_id, b.sql_text FROM session $ v a, v$ sql b WHERE a.sql_id = b.sql_

    The listed application is good, but does not limit the output of your session - it should return data from all sessions.

    You must add an AND condition in the WHERE clause to limit your session. You can try this (untested)

     where audsid=(select userenv('sessionid') from dual);
    

    You can also perform a SQL trace and tkprof to obtain data to SQL executed the trace start and end of the trace.

  • How to save data in the text file of Spartan 3

    Hi all

    I would like to kindly save the data table text file or a spreadsheet on vi using fpga spartan 3e as an fpga target. Once I added all the functions related to the operation of file, it gave an error that these functions are not supported by the target device.

    could you please help me with this

    Thank you

    Rania

    Hi David,

    Thank you for posting. You use LabVIEW? If so, what version of LabVIEW FPGA do you use? You use a host VI, or any deployment of code at your target to run? The file IO VI probably won't compile to target because they are not intended to be used on your host computer. Resources and the paths of files do not exist on the target FPGA, but rather on the side of the host. I have included a link below that describes how to transfer data between the FPGA and host. I hope this helps!

    http://zone.NI.com/reference/en-XX/help/371599F-01/lvfpgaconcepts/pfi_data_transfer/

  • How to save data from the COM port to file?

    Hi all

    can someone tell me please how to save data from the COM port on file? I transfer 1 byte of serial port... attached is the image of the vi... very basic.

    I would like to save the data in a table... I mean, 1 data--> data--> data tab 2 tab 3rd--> tab

    and so on... can anyone help?


  • Failure to EXE to EXPORT DATA to THE Clipboard

    LV 2010, Win Vista, Win7.

    A TABLE indicator has a context menu that can EXPORT DATA to the Clipboard.

    In LV2010 (and LV2010 SP1), this function does not work in an executable file - it works very well in the dev system. LV.

    It was fixed in LV 2011, but we can't move to that at the present time.

    What is the best way to take advantage of this feature in LV2010?

    See this JING

    Actually, there is an easier way.  The table has a method called "EXPORT DATA to THE Clipboard".  Apparently, the method is OK, it is not only called on the menu, when in an EXE file. This is a bug of LABVIEW.

    I added only a button called 'EXPORT', an event to respond to a CHANGE OF VALUE on this button and a NŒUD INVOKE to call this method.  It exports very well selected cells.

    Thanks for your idea, if.

Maybe you are looking for