Multiple Query Result tabs

Is it possible to have a new Query Result tab opened every time a query is run instead of overwriting the current contents of the window Query Result tab?
thanks,
Louis

Hi Louis,
Welcome to the forum. Here is a thread with some posts telling you how to control this, both for Query Results and the Object Viewer:
Re: SQL Developer no longer letting me look at the same table name on 2 servers
Regards,
Gary

Similar Messages

  • Bug in pinning of results tabs results in multiple query results tabs

    In Tools > Preferences > Database > Worksheet there is an option called Automatically Freeze Reult Tabs.
    This option, when unchecked, does not seem to be working. New query results tabs are created when pressing F9 to run selected query text.
    Elsewhere I have read that this is a known bug (9247525). A work-around is said to be to not select text before pressing F9. However, this does not seem to always work for me. Sometimes SQL Developer tries to execute code that is outside of the immediate query. The result is usually a query error.
    Thus a whole bunch of query result tabs build up.
    Is this bug being addressed? Is there a place where these bugs can be looked up? Or that status of a bug checked?
    Thanks for any assistance.
    (I am on 2.1.0.63. On Windows.)
    --Michael                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    The bug you have found will be somewhere in the list of work for the SQL Developer team and should get fixed and included in a public release/patch eventually.
    It sounds like your issue with the workaround (statement being identified based on cursor position) is with SQL Developer's pickiness with what is the end of a statement. As a general rule, SQL Developer will only consider a ; at the end of a line or a / starting a new line as the end of a statement - it does not consider a blank line the end of a statement. For example, the following is all considered a single statement:
    select * from dual
    select * from dual;theFurryOne

  • Query result tab is not showing up

    I accidentally hit the x and its gone. How do I get it back so my tables show? I am pulling my hair out trying to figure this out.

    Welcome to the forum!
    Whenever you post provide your full sql developer version, 4 digit Oracle version (if using Oracle) and platform.
    >
    I accidentally hit the x and its gone. How do I get it back so my tables show? I am pulling my hair out trying to figure this out.
    >
    What 'x' are you talking about? If this was a query result tab you need to rerun the query.

  • Multiple query results in HashMap

    Hi,
    Can anybody tell me how I can store multiple results of a select query in a HashMap. I basically know how to do it but here is the problem:
    I want the table ids to be the keys and ArraySets containing database data to be the values of the HashMap. But whenever I add a new key/value pair to the HashMap all the values get overridden with the ArraySet I add.
    Here is my code:
    public HashMap getResults() throws Exception {
    Class.forName(org.gjt.mm.mysql.Driver);
    Connection con = DriverManager.getConnection(jdbc:mysql:///myDbName?user=user&password=password);
    HashMap hmResults = new HashMap();
    ArrayList alValues = new ArrayList();
    PreparedStatement preparedStatement = con.prepareStatement("select id, name, email from mytable");
    ResultSet resultSet = preparedStatement.executeQuery();
    if (resultSet != null) {
    while (resultSet.next()) {
    alValues.clear();
    alValues.add(resultSet.getString("id"));
    alValues.add(resultSet.getString("name"));
    alValues.add(resultSet.getString("email"));
    // the next line adds the correct key and value but also overrides all the other values in the HashMap, why?
    hmResults.put(resultSet.getString("id"), alValues);
    return(hmResults);
    The method above returns a HashMap containing the correct keys but the values are all the same.
    What am I doing wrong?
    Thanks for helping me out!

    Because your adding to the HashMap a reference to that ArrayList, not the ArrayList itself. So basically each key in your HashMap references the one ArrayList, which you repeatedly clear and update. In the end, all your keys map to the same reference, which will contain the very last information retrieved from the ResultSet.
    Simple fix... place the ArrayList alValues = new ArrayList() line inside your loop, and each key will be mapped to a different reference.

  • Text File From Multiple Query Results

    SQL Server 2018 R2
    I need to create a text file to send to another company. The file contains 4 main parts: File Header, Master Records, Record Details and File Footer. There can be multiple Master Records and multiple Record Details associated with each Master Record.
    The file should look something like this:
    File Header
    Master Record
    Record Details
    Record Details
    Master Record
    Record Details
    Master Record
    Record Details
    Record Details
    Record Details
    File Footer
    Each line type contains multiple columns that need to be separated with a “|” symbol.
    I can write the queries that will return each record type in the correct order by using a loop. However I don’t know how to get them into a single text file in that order.
    Please avoid solutions that use xml unless it properly takes into account the possibility of special symbols in my data.
    Any help would be appreciated.

    Thanks for the reply.
    I had considered your solution already and found an article explaining the same thing. The problem with it is that I would somehow have to create a loop that would create and combine the files in the right order instead of just three files in a set order.
    That is beyond my current knowledge.
    I have found a messy way of combining all the record types into a single query in the correct order. Using that I should be able to easily export it into a text file. I don't really like my solution but it should work.
    Thanks,
    Scott

  • Splitting  single row to multiple query result

    Hi All,
    I have a column is a table with data seperated by new like . I need to write a select query which can split this to multiple rows .. can any one help me out .
    please see the xample
    select data_comm from customer where rownum=1
    data_comm
    serial=0
    parallel=1
    comm=1
    a single row contain a field called data_comm which has got data stored seperated by new_line
    I need to write a query which can split data on data_comm and give as multiple rows.
    Thanks in advance

    I think something like this would do the trick.
    Part 1:
    select substr(data_comm, 1, instr(data_comm,chr(10),1)) from customer ;
    Part 2:
    select substr(data_comm,instr(data_comm,chr(10),1)+1,instr(data_comm,chr(10),2)) from customer ;
    Part 3:
    select substr(data_comm,instr(data_comm,chr(10),2)+1,instr(data_comm,chr(10),3)) from customer ;
    Maybe the chr(10) is not the used newline char, but you can figure that one out yourself

  • TSQL XML query Results tab: elements crammed together as single line

    Are the elements in a TSQL "FOR XML..." query rendered by default as a single line (wrapped-around)?(i have a screen shot but i am not allowed to post it here until my acct is 'verified').
    When i run
    SELECT    
       c.CustomerID AS '@CustomerID',
       (SELECT
           oh.SalesOrderID, oh.Status
        FROM
           Sales.SalesOrderHeader oh
        WHERE
           c.CustomerID = oh.CustomerID
        FOR XML PATH('Order'), TYPE) AS Orders
    FROM
       Sales.Customer c
    WHERE
       EXISTS (SELECT * FROM Sales.SalesOrderHeader soh WHERE c.CustomerID = soh.CustomerID)
    FOR XML PATH ('Customer'), ROOT ('Customers')
    this is what i get:
    <Customers><Customer CustomerID="11000"><Orders><Order><SalesOrderID>43793</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>51522</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>57418</SalesOrderID><Status>5</Status></Order></Order
    tus>5</Status></Order></Orders></Customer><Customer CustomerID="11008"><Orders><Order><SalesOrderID>43826</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>51282</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>53765</SalesOrderID><S
    rderID>
    Why aren't the results with XML elements nicely ordered, one element per line?
        <Customer CustomerID="11000">
            <Orders>
                <Order>
                    <SalesOrderID>43793</SalesOrderID>.....

    Where are you viewing the result? In SQL Management studio the result will be shown as link which when you click will show XML elements ordered nicely
    I've shown some examples here
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Unable to display results of multiple query in grid in Oracle SQL Developer

    Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
    My question: How to display multiple query results in grid in Oracle SQL Developer.
    Example:
    select * from Employee;
    select * from Department;
    - when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
    - How to display result of both the queries in Grid.
    Any thoughts on this would be really helpful.
    Thanks in advance.
    Harsh

    Hi Harsh,
    I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
    I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
    Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid?

  • Query Results: Retrieve All Rows?

    I was looking for a feature that will allow me to choose to return "all records" to the Query Results window. The current behavior is to fetch 50 records at a time (e.g. fetch 50 records as you scroll through the results = s-l-o-w). What I'd like to do is "Retrieve All Rows" then use to the scroll bar to "smoothly" scroll to the last record. For example, the 8.0.6 version of Query Builder had this functionality and in SQL Developer 3.0, if I right-click on the results. I can choose to "Count Rows...", seems like this would be a perfect place to put a "Retrieve All Rows" option.

    Hi,
    My advice: do something only if there is a business case for it; satisfying your curiosity can get surprisingly expensive.
    You have already read about using Run Statement to execute a SQL statement, then Ctrl-End to auto-scroll to the end. You can try the same for Run Script, but first you will probably need to increase the value of Tools|Preferences|Database|Worksheet|Max rows to print in a script. Of course, taking either of these approaches slows things down due to displaying output and scrolling. Same with SQL*Plus. And, as mentioned previously, Java memory management in SQL Developer can cause slow downs and hangs if the result set is large enough.
    Here is a way to minimize that delay, avoid hangs, and get a more repeatable result:
    1) Save some query to, say, C:\Temp\AllCustomers.sql. For example, "select * from customers;" or "select id from customers;".
    2) Run it from a SQL Developer worksheet using Run Script (F5), or from the SQL*Plus command line, with a script like this:
    set timing on
    set termout off
    spool C:\Temp\AllCustomers.lst
    @C:\Temp\AllCustomers.sql
    spool offEven then you will see that the timing results will vary. Maybe "select *" runs much slower than "select id" because the logical output lines are long and get wrapped into multiple physical output lines in the file. Minimize that by setting linesize to a longer value (but only in SQL*Plus -- it isn't supported in SQL Developer) and repeat the test to see. Maybe SQL*Plus runs it much faster than SQL Developer because one is a command line environment and the other a GUI tool with more overhead. Or maybe the SQL Developer JVM is near its size limit and lots of Java garbage collection is slowing it down. Simple question, complicated answer.
    Regards,
    Gary
    SQL Developer Team
    P.S.: And if by chance you are using a version of SQL Developer so old it does not include the output time in the query result tab's toolbar, using Run Script with set timing on is your only recourse.
    Edited by: gggraham on Oct 27, 2011 4:54 PM

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • SQL Developer 3.0 EA1 - Query Result assumes keyboard focus

    In the Early Adopter 1 release of SQL Developer and noticed that after running a statement in a worksheet the focus for the keyboard is now in the query results pane. This change in behavior from version 2 is slightly disruptive and makes it harder to iteratively build queries or search for data without having to continuously keep moving the cursor back to the worksheet. I am using the linux version if it makes a difference and it happens both when click the run statement button or use the ctrl+enter shortcut key.
    I have been trying out the preview release and all around it looks good and has some very nice improvements. Just this and the missing export to clipboard are the only issues I've had so far.
    Edited by: user5490329 on Oct 14, 2010 9:06 AM

    I agree with the majority of people here that this is annoying and I'd also prefer to leave the input focus in the SQL Worksheet after I hit CTRL+ENTER, so I am looking forward to the fix.
    However, in some cases, it would come in handy if there was a shortcut key to quickly get to the query result tab, just like in TOAD, where F6 is used for this purpose. The same key is reserved for autotrace in SQL Developer, so another function key could be used.

  • Results Tab Not Showing

    I have just installed SQL Developer and when I am creating a new view, I am able to see the sql code but not the results tab window, to see if this is the correct code I am wanting to have. Please let me know what I am dong wrong.

    You have to click the "Run Statement" (green triangle icon) or hit Ctrl-Enter to run the query from the SQL Worksheet, then you will see the results in a Query Result tab. I'm using SQL Developer 2.1.1.64.
    I have clicked on the Run Station but do not have a Query Results tab show. I'm using version the same version as you. All I have is a Statment Output and Data Editor Log at the bottom. I am not seeing any window saying Results.

  • Problem viewing Query Result

    Hi- I occasionally come across this issue when I run any query in SQL Developer (3.0.02), the Query Result tab shows a bold red Exclamation point and the display grid is blank. It says "Fetched 50 rows in 0.235 seconds" but the results aren't displayed. There is nothing wrong with the queries so it seems like some type of display problem but I can't figure out how to fix it. Like I said, it doesn't happen all the time and I run the same saved queries so I know it's not a problem with the actual queries. Has anyone ever seen or heard of this before?

    Hi,
    Sounds like you are using an early adopter version of 3.0. Why not upgrade to the latest production release (3.1.07.42)?
    A similar situation is described in this old thread:
    Re: Randomly not getting query results
    Regards,
    SQL Developer Team

  • 3.1EA1: Query results do not display

    The results of any query I run in 3.1EA1 do not show in the Query Result tab. When I run sqldeveloper.exe from the command prompt, there are no errors. Sqldeveloper 3.0 is fine.
    Oracle Database: 10.2.0.4.0
    Java version: 1.6.0_26
    Operation System: Windows XP Prod sp3

    Hi Raghu,
    Yes, you are correct. It seems to be related to SQLHistory. This is what I did.
    -- Deleted everything in the SQLHistory folder as suggested.
    -- Started SQLDeveloper and ran query from worksheet
    -- Got results fine, but then immediately got a dialog box saying Migrating SQL history.
    -- This produced an error
    source: o.d.worksheet.sqlhistory
    message: sun.nio.cs.StreamDecoder.forInputStreamReader (StreamDecoder.java:52)
    -- After it finished, sql history was filled again with all the files.
    -- Restarted SQLDeveloper and the problem was back.
    -- Discovered in the SQLDeveloper directory (at same level as the SQLHistory folder) another file called SQLHistory.xml (presumably from a previous version which was the one being migrated)
    -- Renamed the previous sqlhistory.xml file and the issue seems to have gone away since only my new SQL in the history folder now.
    However, I assume that over time, the problem will come back when history gets to a certain size ? I did have about 1200 entries in my folder before deleting.
    Will there be a fix for this, as I use sql history quite often ?
    Hope this helps track down the problem.
    Thanks,
    Mark

  • How to set query result to a single window

    I am using SQL Developer 2.1063, and not happy with the default setting of result window. Everytimes when I run a query, the result appear in a new result window. Over a couple of hour I have tense or hundreds of result tabs in the low window. It is not quite fun to remove them one by one.
    I am sure it can be set so that all result appear in one result window, as I am used to in the old SQ Developer version. But I failed to find it in Prefernces and in Help.

    -K- wrote:
    This is fixed in the available 2.1.1.
    Have fun,
    K. K
    I've just tested on 2.1.1 and i came to the same conclusion as user10369687
    - if you check the box for "Preferences - Database - Worksheet - Automatically Freeze Result Tabs" or click the pin button or run as script (F5) or highlight the sql and run as script (F5) you always get new query result tab.
    The option name suggest that if you check the box the same result tab will be used for different queries which is not true, is the oposite way.
    If the option name is changed than the confusion will be cleared.
    Dani

Maybe you are looking for

  • Business Catalyst in Creative Cloud

    I have a question regarding Business Catalyst.  It seems that with my Creative Cloud subscription I can create 5 sites in either Dreamweaver or Muse, and upload to Business Catalyst.  But when I log on to manage my site it seems I get parts of Busine

  • Read Only Fields

    When a read only field is in a user role and the field is removed, the read only flag disappears. How can controls be implemented so that a role can not be added back in and the read only doesn't follow. It is important to have some fields read only

  • BI Accelerator used in combination with SAP Business Objects Explorer

    Hi , If you use SAP Netweaver BWA and SAP Business Objects Explorer Blade, do you only get the full benefit with using SAP BO Explorer, or will the same queries ran in BEx 7 Anaylser also benefit from the in memory OLAP processing? I'm guessing that

  • Windows : Syncing photos Events, Faces and Places from Phtoshop Elements 8

    Hi everyone, I buy an iPad yesturday and i try to sync my photos. I'm a PC user (windows 7 x64) so I try to use Photoshop Elements 8 in order to sync my photo with iTunes as describe in the iTunes manual. Unfortunatly, I can sync the photo albums onl

  • HT4356 Do I need an Internet connection to AirPrint?

    Do I need an Internet connection to AirPrint from an iPad 2, I only have 3G at home and no home broadband. I have been told as long as I have a router and iPad and printer connected to it, it will AirPrint, is that correct?