views:

884

answers:

2

In the free application SQL-Developer (provided by Oracle), I tried searching around for this but couldn't immediately find a solution. I find the opening of multiple SQL query result window/tabs mildly annoying. I'm sure there are very useful cases for this feature, but my question is: Can we turn the multiple query result windows to just one (Toad style). If there's a shortcut key for this, that would be super awesome.

Cheers.

A: 

Directly to the database or from an application? Do you mean returning one result set from multiple tables together or multiple result sets in one pane? Are you using SQL 2000, 2005, 2008, or something else? The question is vaguely worded, but I'll try to help anyway.

For the purposes of this answer, I think you're trying to query the database directly. Open SQL Server Management Studio 2005 or newer (Not sure if this works in 2000), click New Query, and type the multiple queries into the pane. i.e.:

select * from table1
select * from table2

will return two result sets in the same window/pane.

tsilb
tslib, appreciate the help.But,I think my question was not clear enough. I use Sql-developer (a free application for doing DB stuff).It has this default functionality where if you execute an SQL statement,it opens up a tab window called "Query Result"(for each execution).So,if I hit the "execute sql button" 4 times,it opens 4 separate "Query Result" tab windows.I would like to display my results in a single Query Result window. I doubt this has anything to do with SQL queries.I think it's more of a configuration setting for the application sql-developer.. Hope this details out my requirement.
Kaushik Gopal
What if you put four queries in the same input box?
tsilb
Executing both queries together, opens up two separate query result windows, each with respective results. So executing the query you put up in the answer, would pop two query result tabs first tab containing rows of table1 and second tab with rows of table2.Granted this is cool, but in my regular working, i like to work on a single query, tweaking it to check results. Currrently, with sqldeveloper though, it popups separate query result windows for each modification to the query. What i want essentially is one working palette so to speak..
Kaushik Gopal
+3  A: 

So, it turns out this is a bug. If you look closely, you'll notice that for each query run, your results tab is automatically being pinned, causing each new query run to need it's own new tab to display the results.

The automatic pinning is only supposed to be enabled when you explicitly go into Tools->Preferences->Database->Worksheet->"Automatically Freeze Result Tabs".

It is an identified bug, that Oracle fixed with SQL Developer 2.1.1.

Go to oracle.com and download the latest version and this should go away. It was definitely very annoying.

John Weicher
Thanks John! downloaded the latest version and doesn't annoy me with multiple windows. Cheers.
Kaushik Gopal
thx John, it's OK with the new version
river0