Excel Query...

I am using MS Query to pull data from an Oracle database. I am able to pull the data into MS Query by opening the query 'oracle.dqy' but when I return the data to Excel I get the error messages below:
[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
I am running oracle 9i release 2 client. I have simplified the SQL to the point it pulls the whole table of 3200 records but it still doesn't return to Excel.

username/password@servicename
Check your tnsnames.ora file. Make certain that what ever is the service name (net service name) you are using exists in this file. If it does not exist, create an entry or use an existing entry.

Similar Messages

  • Using a SQL for Oracle in Microsoft Excel Query

    I am having the most difficult time (in fact, I can't get it to work) trying to use an SQL I created in Toad for Oracle. It works fine in Toad for Oracle...gives me all the data I need. I am trying to use it in Excel for users that don't know SQL or Oracle so they can use the query to extract data they need for Charts, Graphs, etc.
    Here is the SQL code from Toad for Oracle:
    /* Formatted on 2006/09/22 11:42 (Formatter Plus v4.8.6) */
    SELECT a_compl_summary.incident_number, a_compl_summary.case_number,
           a_compl_summary.part_sequence, a_compl_summary.part_number,
           a_compl_summary.lot_number, a_compl_summary.alert_date,
           a_compl_summary.entry_date, a_compl_summary.NAME,
           a_compl_summary.MONTH, a_compl_summary.product_family,
           a_compl_summary.complaint, a_compl_summary.reportable,
           a_compl_summary.product_returned, a_compl_summary.case_desc,
           a_compl_summary.failure_invest_desc, a_compl_summary.lhr_search,
           a_compl_summary.root_cause, a_compl_summary.corrective_action,
           a_compl_summary.region,
           rp_qa_reported_device_codes.reported_device_code,
           rp_qa_reported_device_codes.reported_dev_clarification,
           rp_qa_reported_device_codes.reported_dev_code_desc,
           rp_qa_patient_codes.patient_code,
           rp_qa_patient_codes.patient_code_clarif,
           rp_qa_patient_codes.patient_code_severity,
           rp_qa_patient_codes.description
      FROM chsuser.a_compl_summary,
           chsuser.rp_qa_patient_codes,
           chsuser.rp_qa_reported_device_codes
    WHERE (    (a_compl_summary.product_division = 'CP')
            AND (    a_compl_summary.entry_date >= :date1
                 AND a_compl_summary.entry_date <= :date2
            AND (   a_compl_summary.product_family LIKE :pf1
                 OR a_compl_summary.product_family LIKE :pf2
                 OR a_compl_summary.product_family LIKE :pf3
                 OR a_compl_summary.product_family LIKE :pf4
                 OR a_compl_summary.product_family LIKE :pf5
            AND (a_compl_summary.region = :r1)
            AND (   a_compl_summary.NAME = :c1
                 OR a_compl_summary.NAME = :c2
                 OR a_compl_summary.NAME = :c3
                 OR a_compl_summary.NAME = :c4
                 OR a_compl_summary.NAME = :c5
            AND (a_compl_summary.complaint = :yorn)
            AND (   rp_qa_reported_device_codes.reported_dev_clarification LIKE
                                                                              :cl1
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                                                                              :cl2
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                                                                              :cl3
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                                                                              :cl4
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                                                                              :cl5
            AND (rp_qa_reported_device_codes.reported_dev_clarification NOT LIKE
                                                                              :dc1
            AND (a_compl_summary.incident_number =
                                               rp_qa_patient_codes.incident_number
            AND (a_compl_summary.case_number = rp_qa_patient_codes.case_number)
            AND (a_compl_summary.part_sequence = rp_qa_patient_codes.part_sequence
            AND (a_compl_summary.incident_number =
                                       rp_qa_reported_device_codes.incident_number
            AND (a_compl_summary.case_number =
                                           rp_qa_reported_device_codes.case_number
            AND (a_compl_summary.part_sequence =
                                         rp_qa_reported_device_codes.part_sequence
            AND (rp_qa_reported_device_codes.incident_number =
                                               rp_qa_patient_codes.incident_number
            AND (rp_qa_reported_device_codes.case_number =
                                                   rp_qa_patient_codes.case_number
            AND (rp_qa_reported_device_codes.part_sequence =
                                                 rp_qa_patient_codes.part_sequence
           )Can someone help me...maybe point out what I'm doing wrong.
    Note: I also tried creating this query in Microsoft Query (the simple way) and when I first create it...it works...But then if I go back in to edit the query, and refresh the query or try to Return data to Excel, it gives me a ORA-00936 error message.
    Why it works when I first create the query in Excel, I don't know. But I have to validate the queries I'm creating (SQL or not) and I can't validate it if every time I go into edit the query (which may have to happen; that's why I have to fix this before I can submit my validation).
    Anyway, any help would be greatly appreciated.

    Okay, I know I'm replying to my own threads here...but I want to add a little bit more information again.
    I was successful in figuring out that changing the :criteria to a ? worked.
    I tested this on 1 criteria at a time. Adding one more scenario ? at at time.
    It only worked up until about 3 scenarios of each criteria.
    Then when I refreshed the query in Microsoft Excel Query, I got an "out of memory" error, and then it ended up just erasing the SQL I had been using.
    Here's the SQL I had where it gave me this error. Am I possibly just making Excel work too hard? It just doesn't make sense because Toad for Oracle handled it in like 4 seconds. Which brings me back to an intial question I had. Can Excel use Toad for Oracle somehow?
    Here's the code:
    SELECT a_compl_summary.incident_number, a_compl_summary.case_number,
           a_compl_summary.part_sequence, a_compl_summary.part_number,
           a_compl_summary.lot_number, a_compl_summary.alert_date,
           a_compl_summary.entry_date, a_compl_summary.NAME,
           a_compl_summary.MONTH, a_compl_summary.product_family,
           a_compl_summary.complaint, a_compl_summary.reportable,
           a_compl_summary.product_returned, a_compl_summary.case_desc,
           a_compl_summary.failure_invest_desc, a_compl_summary.lhr_search,
           a_compl_summary.root_cause, a_compl_summary.corrective_action,
           a_compl_summary.region,
           rp_qa_reported_device_codes.reported_device_code,
           rp_qa_reported_device_codes.reported_dev_clarification,
           rp_qa_reported_device_codes.reported_dev_code_desc,
           rp_qa_patient_codes.patient_code,
           rp_qa_patient_codes.patient_code_clarif,
           rp_qa_patient_codes.patient_code_severity,
           rp_qa_patient_codes.description
      FROM chsuser.a_compl_summary,
           chsuser.rp_qa_patient_codes,
           chsuser.rp_qa_reported_device_codes
    WHERE (    (a_compl_summary.incident_number =
                                               rp_qa_patient_codes.incident_number
            AND (a_compl_summary.case_number = rp_qa_patient_codes.case_number)
            AND (a_compl_summary.part_sequence = rp_qa_patient_codes.part_sequence
            AND (a_compl_summary.incident_number =
                                       rp_qa_reported_device_codes.incident_number
            AND (a_compl_summary.case_number =
                                           rp_qa_reported_device_codes.case_number
            AND (a_compl_summary.part_sequence =
                                         rp_qa_reported_device_codes.part_sequence
            AND (rp_qa_reported_device_codes.incident_number =
                                               rp_qa_patient_codes.incident_number
            AND (rp_qa_reported_device_codes.case_number =
                                                   rp_qa_patient_codes.case_number
            AND (rp_qa_reported_device_codes.part_sequence =
                                                 rp_qa_patient_codes.part_sequence
    AND (a_compl_summary.product_division = 'CP')
            AND (    a_compl_summary.entry_date >= ?
                 AND a_compl_summary.entry_date <= ?
            AND (   a_compl_summary.product_family LIKE ?
                 OR a_compl_summary.product_family LIKE ?
                 OR a_compl_summary.product_family LIKE ?
                 OR a_compl_summary.product_family LIKE ?
                 OR a_compl_summary.product_family LIKE ?
            AND (a_compl_summary.region = ?)
            AND (   a_compl_summary.NAME = ?
                 OR a_compl_summary.NAME = ?
                 OR a_compl_summary.NAME = ?
                 OR a_compl_summary.NAME = ?
                 OR a_compl_summary.NAME = ?
            AND (a_compl_summary.complaint = ?)
            AND (   rp_qa_reported_device_codes.reported_dev_clarification LIKE
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
                 OR rp_qa_reported_device_codes.reported_dev_clarification LIKE
            AND (rp_qa_reported_device_codes.reported_dev_clarification NOT LIKE
               ))

  • Hyperion Workspace Financial Reporting Export to Excel Query-Ready Missing

    Hyperion Workspace Financial Reporting Export to Excel "Query-Ready" option is Missing in the dropdown when you go to File>Export>Excel
    Only the "Fully Formatted" option is available.
    From what I recall this option for a "query-ready" export should be available from the HTML preview?
    Is there something in configuration that needs to be enabled or something that needs to be checked on to get this option?
    We are running 11.1.1.3
    The Query-Ready option is available when exporting forms in Planning.
    When opening Financial Reports in Smartview the option for "Query-Ready" is available.
    For some reason this is not showing up in workspace, does it not exist in 11.1.1.3? Is this a bug?
    TIA

    Hi,
    The option to export the financial report output in "Query-Ready" format is actually at the bottom right hand corner of the report page (look at the report footer) instead of File>Export>Excel.
    Hope this helps
    Genti

  • Translating Excel query into flat file(.CSV)

    Hi,
    I have a requirement where i need the Excel Queries to be displayed in Flat file(.CSV) format.
    To be more clear i have an excel query but  my client requires this query to be displayed in a Flat file format. Can someone explain me how i can acheive this.
    Thanks

    Hi All,
    Thanks for all the information provided by i missed mentioning one point, actually thse queries are to be automatically schedule. the requirement is like this i need to bring to extract data and build queries export it as a .CSV file these queries are not end user queries so they have to be automatically scheduled and will be picked up by an interface so they do some mapping with the .CSV file we provide.
    So we decided to do it in Reporting Agent in Excel format and automate it and send the file to a specific location from where the Interface team can pick it. which doesnt need an user to run the query.
    so can someone tell me if i can automate a query and as well as have the query in .CSV format?? I hope i was clear
    Thanks.

  • Execute SQL Task fails when specific column names are mentioned in Excel Query

    Hi,
    I have a requirement for extracting Excel data with thespecific column order. So instead of using the below query,
    Select * From [Sheet1$A1:ZZ1]
    I use the below one,
    Select col1,
    col2,
    col91
    From [CRM$A1:ZZ1]
    So I have totally 91 columns.
    I don't face any issues when i use the before query. i.e. direct select * from sheet1
    But when i specify column names and do a select from the sheet it throws error as below,
    [Execute SQL Task] Error: Executing the query "Select
    [Col1] 
    From [Sheet1$..." failed with the following error: "No value given for one or more required parameters.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not
    set correctly, or connection not established correctly.
    I just need to retrieve the column name alone and not any of the values to it. So when i do simple select * it gives the column names in the order of what it is been with the excel. But i do want it to be sorted in alphabetically and to retrieve the column
    names. 
    I am not getting any proper solution for this for past 1 and a half days. May anyone of you please help me get it sorted? - Thank you!
    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Please use something like below:
    SELECT F1 AS Col1, F2 AS Col2, F3 AS Col3, ...
    FROM [Sheet1$A1:ZZ1]
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • Add-in Excel - query disconnected

    I installed on a virtual PC :
    - windows server 2003
    - Oracle DB 10.1.0.2
    - Database patch 10.1.0.4
    - Global schema (sample schema for OLAP)
    and I am using Excel Spreadsheet version 10.1.2.0.36 to connect to OLAP cube.
    I can connect to the cube and play with it, but get regulary disconnected with BIA-4018 Error.
    Does anyone knows the cause of this error ?
    Thanks
    Cedric

    I would appreciate some help on the same topic as described above.
    I have installed
    Oracle Database 10g 10.1.0.2.0
    - PatchSet 1 - 10.1.0.3.0
    - BI Common Schema from "BI Samples" (version 10.1.2.0.0_c in version.txt)
    - Interim Patch - Olap Patch for 10.1.0.3.0 (1010310408050001)
    - Oracle ODBC Driver 10.1.0.3.1
    When running Oracle BI Spredasheet Add-In (build 10.1.2.0.36) I open
    samples.xls and connect to my 10g database as CSL_OLAP user,
    connection is successfull but refresh of any query in XLS fails
    with message: BIA-4018 (failed to refresh query).
    I have tried to rename XLS file and reopen it, but error BIA-4018 still appears.
    Also when running from Excel menu under Oracle BI "New Query" wizard, the second screen (after selecting layout) will hang.

  • Excel Query case sensitive problem

    HI all I am writing query in excel to join table. however I find it is case sensitive.  which cause many trouble.
    how to make it case incensitive.
    SELECT *
    FROM `C:\compare.xlsx`.`sheet1$` a
    left join `C:\compare.xlsx`.`sheet2$` b
    on a.`name`=b.`name`
    union
    SELECT *
    FROM `C:\compare.xlsx`.`sheet1
    right join `C:\compare.xlsx`.`sheet2$` d
    on c.`name`=d.`name`

    Hi,
    I tested it with my data source (I create it like this, not use all of the month). Would you like to share us a sample file through OneDrive if possible?
    If you have further question about the SQL sentence, I recommend you post your issue to SQL forum.
    http://social.technet.microsoft.com/Forums/en-US/home?category=sqlserver
    Regards,
    George Zhao
    TechNet Community Support

  • Simple excel query

    Hi,
    I am connecting to an excel spreadsheet. I have no problems connecting but when I query it my app. goes into an infinate loop.
    When coding:
    rs = stmt.executeQuery(query);
    while(rs.next()) {
    // display my results
    I get valid results fine but after my data has run out the rs.next() still returns true. I only have 25 rows in my spreadsheet but when viewing the sheet in excel all the rows after the 25th are blank. Is there a way in excel delete all the rows after 25th?
    I hope someone knows what I'm trying to say and can give me the simple solution I'm sure I'm missing!
    Much appreciated,
    Vaughne

    What I would do is simply check if an entire row in your result set is empty. If so you keep track of that with a counter.
    As you can see sometimes there can be empty lines for formating an excel sheet. I would pre-define a number which tell how much rows maybe
    empty after eachother. For example 10. Once exeeded this number you stop your loop.
    After that to delete the last lines simply do current row number - 10
    the predefined number (10) and delete does.
    I see you display your data emediatelly.
    This has to be changed. And you need to put this into a vector.
    This way you can operate on deleting some rows if you want.
    Afterwards just loop over the vector and display your results.
    Now how does this work.
    Cell 1 Cell2 Cell3
    1 2 3
    5 7 7
    5 1 9

  • Export pdf to Excel query

    I have just signed up, but when I try to export my pdf to Excel I receive a sign-in error.
    I signed out of my account, cleaned my cache, but the same error message came up on my next try too.
    Can anyone advise please?

    Hi lynnmat,
    It can take a few hours for your account to process fully. And, in looking at your account, I see that it's still "pending." If you're still unable to log in in a few hours, please let us know and we can take a closer look at what's going on.
    Best,
    Sara

  • FR error exporting to  excel Query ready mode

    We are getting an error while exporting to Query ready mode. Error says report is not a valid single file web page.
    but its working for other user.
    any clue.

    check this might help :
    Re: "not a valid single file Web Page"

  • Excel query/macro , delete records where the aggregate value is not over 100

    I have a spreadsheet with about 5000 records. I need to delete out the records where the Amount column is less than $10.00 unless the aggregate of the amount column is greater than or equal to $100. I have an ID column that matches to the name on the record.
    So is it possible to create something that for each ID number in the ID column if the Amount column is less than $10 delete it unless the same ID appears again and is greater than $100? TIA

    HI mkozz28,
    >> I need to delete out the records where the Amount column is less than $10.00 unless the aggregate of the amount column is greater than or equal to $100.
    In my option, you could sort the data by column ID, then loop through the column Amount, if the value of the Amount is less than 10, then find the cell according the same ID, if the Amout is less than 100, delete the enterRow.
    For more information about Find method, you could turn to the link below
    # Range.Find Method (Excel)
    https://msdn.microsoft.com/en-us/library/office/ff839746.aspx
    For the row delete, the link below might be useful to you
    # Delete Method [Excel 2003 VBA Language Reference]
    https://msdn.microsoft.com/en-us/library/office/aa223863(v=office.11).aspx
    A simple demo as below, you need to modify it to your own requirement.
    Sub test1()
    For i = 2 To 8 'row number
    Debug.Print ActiveSheet.Cells(i, 2).Value
    'ActiveSheet.Cells(i, 2).Select
    If (ActiveSheet.Cells(i, 2).Value <= 10) Then
    Set cell = ActiveSheet.Range("A1:A8").Find(ActiveSheet.Cells(i, 1).Value, After:=ActiveSheet.Cells(i, 1), LookIn:=xlValues)
    If cell Is Nothing Then
    ActiveSheet.Cells(i, 2).EntireRow.Delete
    Else
    Debug.Print ActiveSheet.Cells(cell.Row, 2).Value
    If ActiveSheet.Cells(cell.Row, 2).Value < 100 Then
    ActiveSheet.Cells(i, 2).EntireRow.Delete
    End If
    End If
    End If
    Next i
    End Sub
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Oracle query export into the Excel file

    Hi,
    How can i automatically export oracle query result into the excel file in oracle?

    SQL and PL/SQL FAQ
    Re: Excel query to Oracle Database
    http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-query-oracle-from-excel-2007/
    Edited by: swapnil kambli on May 28, 2013 11:07 PM

  • Excel Multi Value Parameter fails

    I have a stored proc that i pas through multiple values to one parameter. In SSMS this works perfectly. From excel i have a range of ids that i put into one cell as csv's. If i put 21 ids this works perfectly, if i exceed 21 i receive the following error.
    bad parameter type. microsoft excel is expecting....
    In ssms ive passed up to 2000 id's, and returned what i expected. Any thoughts on why exceeding 21 values in excel would cause an error? Thanks.

    Hello,
    According to your description, the stored procedure works well in the SSMS but failed in Excel query when pass multiple values to the parameter.
    The following thread is about a similar issue and it seems that there is a 255 characters limit if you execute the SQL Server stored procedure from Excel VBA.
    http://stackoverflow.com/questions/20731576/excel-microsoft-query-parameter-length-limit
    http://support.microsoft.com/kb/105416
    You can refer to the following thread to troubleshoot this issue:
    Getting around the Max String size in a vba function?
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Project Report for One Project Using Excel

    Hi,
    Is is possible to create a report for one project using excel?
    I want to create a pdp with an Excel Viewer web part and have the following tabs with data specific to the one project.
    1. Cover
    2. Issues
    3. Risks
    4. Deliverables
    I tried passing the ProjUid to an Excel doc via the Excel Query Filter Web Part and was able to filter the Issues lists only but don't know if its possible to filter out the other tabs by using the same paramater. Is this possible?
    I have not looked at Odata but was wondering if it was possible to pass a paramater to the odata query and still have the spreadsheet work in a web view in SharePoint?

    Hi,
    I'd say that as far as you promote the Proj UID field as a filter in all sheets of your Excel workbook, using the Excel
    Query Filter Web Part should work fine. But testing it should be easy, since you already did half of the work.
    See excellent article from Andrew on this topic:
    http://azlav.umtblog.com/2012/12/05/filtering-excel-webparts-in-office-365-part-2/
    http://azlav.umtblog.com/2012/07/03/creating-a-project-resource-list-in-a-pdp/
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • What is Excel doing?

    Hello,
    We have a simple cube prototype with one fact table and two dimensions (on SQL Server 2008 R2)
    When I place two fields, one from each dimension, on the Excel pivot table designer, Excel shows data. In particular, it shows over 6000 rows for the unknown member of the first dimension's field.
    When I try to do the same in Visual Studios Cube browser, no data is shown until a measure is added to the pivot area. 
    What is Excel doing that is enabling it to show data without a measure from the fact table being included? The MDX generated by Excel is shown below. I can see it is doing a cross join, but can't replicate this in SQL using the data warehouse tables. What
    is the equivalent SQL?
    Excel generated MDX
    SELECT NON EMPTY CrossJoin(Hierarchize({DrilldownLevel({[Dim Event].[EVENT CODE].[All]},,,INCLUDE_CALC_MEMBERS)}), Hierarchize({DrilldownLevel({[Dim Supporter].[Supporter URN].[All]},,,INCLUDE_CALC_MEMBERS)})) DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME
    ON COLUMNS  FROM [Simple Cube] CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS
    Excel output

    Thanks for the tip.
    My problem is this: the Excel query take a very long time to run. DimEvent has only 700 rows and DimSupporter has 10,000 rows. I get the impression that Excel is doing a cross join resulting in a lot of rows. This is obviously frustrating for the user as
    Excel takes a very long time to give control back to the user.
    Also, without a fact table measure in the pivot, how does Excel know which Event Code and Supporter URN are related? Because of the star schema design, the only link between the two dimensions.
    Hi Amir,
    In SQL Server Analysis Services Cube, there is a default measure which you can see on the link below.
    Besides, for the performnce issue, used CrossJoin function to join multiple dimensions which might cause the performance issue. If you cross-join medium-sized or large-sized sets (e.g., sets that contain more than 100 items each), you can end up with a result
    set that contains many thousands of items—enough to seriously impair performance. For the detail information, please see:
    http://sqlmag.com/data-access/cross-join-performance
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • IDCS3 - Mac:  Plugins do not show up on production machines

    I have converted a series of plugins on my Mac from CS2 to CS3 and have made their release versions available to our production people. I can see them fine on my box, but when the plugins are installed on Macs other than my own the plugins do not sho

  • No sound at all after 10.4.6 update

    Hi, does the 10.4.6 update have a firmware update included ?, because after restart etc no sound at all eminates from my powerbooks built in sound. No start up chime, system sounds .... nothing [only thing i can see in "sound on the system prefs is a

  • Count the no.of rows without using count function

    Hi, How to count the no.of rows without using the count function? Thanks,

  • Can't recognize movie files.

    My girlfriend made a video on iMovie and sent it to me through email and I am having a problem opening it be ause it is saying the movie's file can not be recognized by QuickTime player. What do I do to make it work?

  • Acrobat 8 & Acrobat Reader 8 slow to open PDFs across WAN

    I'm currently having a really strange problem with the users in one of my offices when they attempt to open PDFs with either Acrobat Pro 8.1.2 or Acrobat Reader 8.1.2. These users are connecting across a WAN via a point-to-point T1 to the main locati