How to Export Table Data to a excel sheet using OPENROWSET

Hi Team,
I would like to Export table data to a excel sheet by using "OPENROWSET" command in SQL Server but I am getting the
below error message
Column name or number of supplied values does not match table definition.
Please help me on how to export the table data to an excel sheet by using "OPENROWSET" in SQL Server

I know this is old so I assume you've fixed this. However, for anyone else looking at this forum, I'd recommend using a union or a table join.
Select a.1, a.2, a.3 from a <where clause>
union
Select b.1, b.2, b.3 from b <where clause>
or
use a type of join.
If both table selects return the same number of columns but different data just reference them as a variable like fred, and Ted
Select fred.1, fred.2, fred.3 from (Select a.1, a.2, a.3 from a) fred
union
Select Ted.1, Ted.2, Ted.3 from (Select b.1, b.2, b.3 from b) Ted
or again some type of join of these two sets
Select * from
(Select a.1, a.2, a.3 from a) a
INNER JOIN (Select b.1, b.2, b.3 from b) b ON b.1 = a.1
This would give you 6 columns of data a1-3, and b1-3
We don't know from your description what format your spreadsheet is in. These just give you the idea. Think of the sub-selects as a Table. It's just named "fred". Once your select holds all the data you need, then export the data to the spreadsheet. Use
the horsepower of the database before trying to do a multple update of the same spreadsheet.
Does this give you enough to fix what you were trying to do?   

Similar Messages

  • Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)

    Hi experts,
    I am trying to implement the functionality of downloading the contents of a webdynpro screen to excel sheet. In order to implement the functionality of excel download i used the following blog.
    [/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache ]
    In this blog they have used javaexcel api to implement the excel functionality. I face some problems
    while implementing it.
    i) The use of "Label label = new Label(0, 2, "A label record");
    sheet.addCell(label); " is not supported. It says that a constructor for label with
    (int, int, str) parameter is not available.
    ii) Then i implemented it with "Label label = new Label("A label record"); " Then i deployed it. I got a runtime exception saying that " java.lang.ClassNotFoundException: jxl.format.CellFormat ".
    This cellFormat is an interface available in the jar. I am using jexcelapi_2_6_9_1.4 version. Do i have to
    download some other versions.
    Please help. Thanks in advance.
    Regards
    Ramanan

    Hi,
    Please check the following steps while creating External Library DC:
    1) creating an Extneral library DC
    2) import the JARs to the libraries folder of the External Library DC project
    3) Right-click on each of the JARs imported to the project and add them to the public part.
    This DC is now ready to be used as a build-time reference that will allow CBS to build the "main" Web Dynpro application that will use the external libraries. Next, we have to create a new Web Dynpro DC to hold the class files here are the steps:
    1) Create a new Web Dynpro DC
    2) Create a new public part, selecting the "Can be packaged into other build results" option
    3) Rename the JARs as Zip files and extrct the full content (folders and class files) to your root folder
    4) Import the folders and files to the src/packages folder
    5) Expand the public part node that was created and select the "Entities" node, right-click it and choose Edit
    6) In the Entity Type list select the "Folder" option then in the selected entities tree pick each of the folders that you imported in step 5 (above)
    7) Now do a DC build and a DC deploy of the project
    Then check-in, activate, and release any activities you have associated with creating these two projects. In the DC perspective, refresh the Active DCs and Inactive DCs to ensure that both new DCs appear in the Active list. Now we have to setup the references to these DCs in our main Web Dynpro application. To do this, follow these steps:
    1) Open the Web Dynpro perspective and right click the Used DCs node then choose "Add Used DC.."
    2) Pick the public part of the External Library DC that we created (first) and set it to have a Build Time dependency
    3) Again, right click the Used DCs node and choose "Add Used DC.." then choose the public part of the Web Dynpro DC that we created and give it a Run Time dependecy (weak) and click finish.
    4) Now, due to what I think is a bug. You must right click on the Web Dynpro "used DC" that you just added in the previous step, and set the run time dependency again (it seems to revert to the default values for some reason)
    5) Now do a DC build and a DC deploy on the "main" web dynpro application.
    6) Check-in, activate, and release any activities associated with adding these references and then others on your team may use the classes in the external libraries within the Web Dynpro project.
    Regards.
    Rajat

  • Exporting table data to MS-Excel Sheet 2000

    Dear All,
    I just wanted to export my webdynpro table data to MS-XL 2000 version.
    I know how to do it in XL-2003.
    pl help.
    Thanks & Regards
    Manoj Sahoo

    Hi Manoj,
    Go through this link to export the data to MS-Excel, it also provides you the sample application and PDF.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/1208c2cd-0401-0010-4ab6-f4736074acc6">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/1208c2cd-0401-0010-4ab6-f4736074acc6</a>
    Regards,
    Jhansi

  • How to export table data to excel in albpm

    Hi,
    we have an requirement to export table data to excel .
    we have to create an jsp in that jsp we have to have text fileds,we have to enter data to field after that we have to click on save once u click on save that data has to enter in below table and we should provide link to export that table data to excel.
    this is our totatl requirement.can u please suggest me how to do,i dont have any idea..
    Regards,
    Sharmila
    Edited by: user12171025 on Nov 5, 2009 8:44 PM

    Hi Daniel 
    Please have a look at below docs :-
    /people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
    http://wiki.sdn.sap.com/wiki/display/WDJava/ExporttoExcel(WithoutthirdpartyAPIs)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d01854fd-1579-2c10-63ad-dd62edca2381?quicklink=index&overridelayout=true
    Regards
    Arun Jaiswal

  • How to export the data to a excel file from RSA3?

    Hi experts,
    1.I am trying to save the RSA (SRM extractor) to excel spread sheet to compare SRM data with BI data. When i run the the transaction RSA3 it just showed me 10 different data packets. How to export the data to excel spread sheet for reconciliation?
    2. Does any body know if the stepup tables exist for SRM extractors?
    Thank in advance
    Sharat.

    Hello Sharat,
    You have two options of saving data to excel sheet:
    Step 1: 
    Goto RSA3, change the "Data Records / Calls" to 1000 and then execute. This way instead of 10 different packets you will get one packet.
    Step2:
    Click on the list button, open the packet by double clicking it. You will see all the data on your screen.
    Step3:
    Goto System -> List -> Save - > Local File -> Spreadsheet and give some name for your xls file.
    Assign points if helpful.
    Regards,
    F-S

  • How to show a table data into an excel sheet

    Hi
    I have  a requiremet of generate an excel sheet with the data that is there in the table...
    I have an inputfiled ..if i enter data and clicks search the data related to it is displayed in table.here i want to generate an excel sheet with the data that is there in the table
    Regards
    Padma

    Hi Rekha,
    i have a dout in  Exporting Table Data Using On-Demand Streams - SAP NW 7.0 which is the subdivision (B) .
    In this he created Excel node with Resource--type(Resource)
                                                      ResourceOnDemandStreamCal--type(com.sap.tc.webdynpro.programmodel.api.IWDInputStream)
    1)i went to LocalDictonaries and in that com.sap.ide.webdynpro.UiElements--In that i dont have Resource
    2)i typed com.sap.tc.webdynpro.programmodel.api.IWDInputStream in native type
    but nothing is comm
    how to get these types
    Regars
    Padma

  • How to export table data with coloring of cell according to value.

    Hi all,
    I am using jdeveloper 11.1.1.6
    i want to export table data with lot of formatting. like with coloring of cell according to value and so many.How to do that?

    Hi,
    like with coloring of cell according to value and so many.How to do that?
    Answer is, you can't
    Frank

  • How to put the data from one excel sheet in another excel sheet

    hi ,
    I want put the data from one excel sheet in another excel sheet in seq. order Eg: I have one excel sheet in which i have 3 col. Name , Sno. , Email along with data .I want to put data from this sheet to another excel sheet in the following orders of col. Sno,Name, Email .
    While loading data in another sheet , i have to perform validation like char field should n't contain numeric values and vice versa .
    Let me know on this soon ..
    regards
    Prashant

    Well, you can issue separate queries with the ordering you need from each tab in the spreadhseet. You can open an ODBC connection from a VBA macro, select a sheet, run a query, select another sheet and run another query. As for the validation, you can do this in Oracle via stored procedures or again in VBA code.

  • How to export the data to a  Excel file

    Hi all,
    How to use the  'EXCEL_OLE_STANDARD_DAT'
    to export the data from itab to EXCEL file.
    REPORT  ZT11.
    data : begin of itab occurs 0,
          t1(3)  type c  value 'sag',
          t2(3)  type c value 'ntc',
          end of itab.
          append itab.
          write : itab-t1,itab-t2.
          CALL FUNCTION 'GET_FIELDTAB'
          EXPORTING
            LANGU                     = SY-LANGU
            ONLY                      = ' '
            TABNAME                   = ' '
            WITHTEXT                  = 'X'
          IMPORTING
            HEADER                    =
            RC                        =
            TABLES
              FIELDTAB                  =
          EXCEPTIONS
            INTERNAL_ERROR            = 1
            NO_TEXTS_FOUND            = 2
            TABLE_HAS_NO_FIELDS       = 3
            TABLE_NOT_ACTIV           = 4
            OTHERS                    = 5
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
            EXPORTING
              FILE_NAME                       =
            CREATE_PIVOT                    = 0
            DATA_SHEET_NAME                 = ' '
            PIVOT_SHEET_NAME                = ' '
            PASSWORD                        = ' '
            PASSWORD_OPTION                 = 0
          TABLES
            PIVOT_FIELD_TAB                 =
            DATA_TAB                        =
            FIELDNAMES                      =
          EXCEPTIONS
            FILE_NOT_EXIST                  = 1
            FILENAME_EXPECTED               = 2
            COMMUNICATION_ERROR             = 3
            OLE_OBJECT_METHOD_ERROR         = 4
            OLE_OBJECT_PROPERTY_ERROR       = 5
            INVALID_PIVOT_FIELDS            = 6
            DOWNLOAD_PROBLEM                = 7
            OTHERS                          = 8
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.

    Hi, you can even use control technology. There are several example programs how to export data to excel. Please go to transaction SE80. Choose enviroment->examples -> control examples.  Take a look at office integration.
    /Ernesto

  • How do i import data in an Excel sheet into an Oracle Database table

    I know one way to do is to convert the data into a text file and then use Sqlldr to load the data into the DB.
    Is there any other easy way, like directly connecting to the DB from Excel sheet itself. Any links to this wud be greatly helpful.
    Thanks and Rgds,
    Vig

    --Create a DSN (ODBC) from Windows control panel
    Open Excel, Dataimport external data--import data
    --click new source, select ODBC DSN, choose your DSN ..
    --select any table from shown list..next.....                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to export the data from an excel file to Oracle database by using macro

    Hi,
    I want to export data from an excel file into Oracle database.There is one method that by creating the macros through excel we are able to do this.
    can anybody please send me the code to create macros?
    Thanks in advance.
    Regards,
    Surendra.V

    There are several resources on the web, but you could start analyzing if this code fits your needs --> VBA Macro for Excel 2003 Export of Text File with Comma and Quote Delimiters.
    ~ Madrid

  • How to export ananonymus block output into excel sheet.

    Dear all,
    I want to import the dbms_output.put_line output directly into excel sheet.
    Please guide .
    thanks & regards
    Munish

    Hi Munish,
    you can't produce with dbms_output.put_line a file which is directly readable by Excel.
    You can check this post Re: Saving SQL+ output to a text file where I have posted some comments.
    Also this Re: Extract data from Oracle in excel file
    Regards.
    Alberto.

  • HOW CAN I GET THE TIME IN EXCEL SHEET USING WRITE TO MEASUREMENT INSTRUCTION

    HI, I am using GET TIME IN SECONDS ,and after that i placed SECONDS TO DATE /TIME instruction ,and i had taken a write to measurement file instruction
    to get the time in excel sheet. Now i am not able to connect write to measurement source to seconds to date and time output . Is there any solution.
    I am attaching my VI file also.
    Attachments:
    TEST.vi ‏43 KB

    Hi
    Im using Labview 8.2. Currently it just shows the data without the time. Im not sure what to do. It works perfectly though. I just want the time to appear on my notepad along with my data
    holla
    Attachments:
    Testing1.txt ‏1 KB
    Untitled 231_LV80.vi ‏23 KB

  • How to write to a password protected excel sheet using ActiveX?

    Hi all,
    I would like to write to a protected Excel sheet. I protect the sheet just in case the data is not wrongly programmatically saved to other cells. These cells contained formulas.
    Please help.
    Thanks,
    keng

    Hi Randy,
    Thank you for looking into my problem.
    I have looked into the Workbook.open property node. There is "password" on the property node. Please see attached diagrams.
    Is is the right way to do it?
    Please advise further.
    For your information, the Excel workbook and sheet 1 are password protected.
    Thanks,
    keng
    Attachments:
    Password_Excel.jpg ‏37 KB
    Password_Sheet.jpg ‏23 KB

  • How to export an array to an excel-sheet

    Hallo,
    does somebody knows how i can write an String[][]-Array in an simple Excel-Table, or knows someone a source where i can find information about the xls-fileformat?

    POI has, however, a programming interface. Relying on the file format alone, you are reinventing the wheel.
    In a production environment I use the comma-separated-value file format to "mock" Excel files and this works.
    Good luck anyway!

Maybe you are looking for

  • How do I recheck the album artwork box which allows for me to see which albums were not able to receive album artwork?

    When I would download album artwork a popup msg would appear notifying me of all the albums that did not get album artwork.  I checked the box the opted me to not see this notifcation msg again.  Now I actually would like to see this notification.  D

  • HT201272 cannot purchase item in game with ipad

    Dear Team, My problem is i cannot purchase chip in poker  that i download in my new ipad but using my ipad as yesterday still ok but now cannot since i change my debit card detail and this is second time happen to me hope can be solve

  • Where is Apple customer support??

    So, I am a new Apple customer. I have had a cell phone since 1996, but my first iPhone was purchased 13 months ago, Because all of my friends couldn't shut up about how great the iPhone is and how great Apple is. In my 17 years of owning a cell phone

  • Ade wont show my ereader

    ok guys you have been so much help so far and i am hoping that once again you will be able to help me.  after having my authorizations reset my e reader worked fine intell today.  now when i plug in my libre it doesnt show up in my bookshelves like i

  • Tracker conflicts with libtracker

    Hi! A few days ago I did a system update and pacman says that tracker conflicts with libtracker and so dependencies could not be solved. I can't remove libtracker, it depends on nautilus, so I removed tracker and a "pacman -Syu" works again. But I ca