Showing posts with label SQL Worksheet. Show all posts
Showing posts with label SQL Worksheet. Show all posts

18 September 2006

Count and Filters...

I'm still testing and working with SQL Developer 1.1, so have neglected this blog for a while. I am sure you're out and about doing the last of summer things, assuming you live north of the equator, or looking forward to spring, if you're down south! Either way, I doubt you'll have missed this too much.

I'm working through my morning tasks and today, that includes reviewing my bugs that have been closed. Here's one I've just looked at.

Users on the forum were frustrated that when you apply a filter to your data, in SQL Developer 1.0 and then tried to Count the records, the response was a count of all the records. So apart from writing the SQL, the request was to know how many records are returned, with a filter applied. Here you go, a simple context menu option:

10 August 2006

Another Peep into the Future...F4 and Filters

A quick entry today. There are 2 small features I said I'd show you, the first is the much requested 'Describe' (F4) feature.

The problem we're solving is that you might be halfway through writing a statement in the worksheet and you want to have more detail about a table or view. You can of course expand the object in the navigator to see the columns. Sometimes that is not enough, so you can click on the table or view and click through the tabs, but what you really want is to be able to describe any object and have the definition show up in a modeless window. If you're lucky enough to work with two monitors, or even have a really big monitor, you can move this window off to one side and carry on with your SQL, while the window describing the object stays visible. The image below shows the dialog describing the table selected.

There will be two ways to access this Describe feature; one is through a short cut key, currently F4, which is configurable, as are your other shortcut keys.The other is through a context menu as shown below:

The second is a brief look at the filtering option. In SQL Developer 1.0, when you filter objects in the Navigator, you are really only limited to searches for objects that start or end with a letter or letters, or those that contains a letter or letters. e.g. E%. or %EMP% pr %ING. Here is the old filter:

The new allows for a combination of requests. Here is an example of the new...

01 August 2006

Run a File in SQL Developer: Easing the Pain

At some point in your working day, assuming you potter with databases, you're probably going to want to run a script. Typically we might use SQL*Plus for this and copy and paste the full directory path. I tend to start the SQLPLUS.exe, and once logged in locate and drag the file to the SQL> prompt and run it. (By using drag n drop, I get the full path and file name.) If I start SQLPLSW.exe, either I type in the full path and file name or resort to various copy and paste steps.

A colleague sitting nearby made one of those "Hey Sue, I really like this feature" comments today. So I wandered over to see her 'feature of the moment'. She was in SQL Developer and running a bunch of SQL scripts. SQL Developer has really eased the pain of doing this task. Maybe the following will help you to.

Start with SQL Developer and open the file you want to run. I'll use demobld as it's short and sweet and pretty safe to execute. (demobld drops and creates EMP and DEPT and is typically used to refresh SCOTT's tables. To find demobld.sql, do a search on your database directory or find another simple script to run.) If you look at the image below, I have circled File ->New, as this is where you can start to open a file. You can see that I have previously opened demobld and so can use the "reopen" menu option. [click image for larger view]


Of course, if you have associated SQL Developer with .sql files, then just double click the file and it'll open in SQL Developer.

Now the first thing to notice is the name of the tab, is the file name. If you have a bunch of tabs open this is useful. The next thing, which is often a great frustration to our users, is the Run related commands are all grayed out.

That's because you have not yet associated the file with a user! Use the droplist on the right-hand side to select your user.

I selected the SCOTT connection. As soon as a connection is selected, the run commands are available. You should use Run Script (F5), as F9 only executes a single statement. This will run the file for your selected user.

By running the script using F5, you run all the commands as the connected user and the output is printed to the window below. If it's a long script with lots of feedback, you can scroll up and down through the window. SQL*Plus can be maddening like that if you don't spool everything out to a file.
...and of course, if you want to rerun the script for another user? Just change the user by using the droplist!

31 July 2006

Something to Whet the Appetite: Sneak Peak 1

Have you been to the SQL Developer home page on OTN recently? Did you spot the Statement of Direction? We have just released this document on OTN and hope it'll give you an idea of the features planned for next few releases.

A statement of direction typically does not drill down to the finer level of the features, so as I was tracking forum issues and the progress of bugs and enhancements logged in the latest developer build, I thought you might be interested in a sneak peak at a few little bits you've been asking for. You won't see these until SQL Developer 1.1, and I'm not a great fan of 'vaporware', so I won't do too many of these, but in the next few weeks I'll do a few little blog entries to show a few things to look out for in SQL Developer 1.1.

Take a look at the Table Definition Tabs:






The illustration shows one of the most frequently requested features, which is to be able to sort on column headers. This feature is throughout the product now on any grid of data, whether it's instance data or the object definitions. Notice that once you've clicked on the column header, in this case Column Name, the direction of the sort is also indicated.

(Just click on the image for a larger view)










The second illustration shows another frequently asked for feature, which is to display a single record on a form layout. This is particularly useful if you have great chunks of text that you need to read.












More later this week.