So, after months of filling out IT request forms, multiple unanswered emails to a council of learn-ed database elders and then finally outright begging, you got a brand-spankin’ new user account giving you access to that important database, time to write some queries! But wait, you don’t know anything about the tables in this database. How do you do this efficiently and intelligently? With Toad Extension for Eclipse and Toad Mac Edition , you can jump in with both feet using the just the Editor without the need to bounce between tools or windows…in other words, write your queries and understand your schema without ever leaving the editor, which means less time spent hunting for a feature or schema details and more time getting the data you need. The SQL Editor is an integral part of the user experience in any SQL Tool. Surprisingly, many tools assume that writing sql is not a differentiator. Toad Extension for Eclipse and Toad Mac Edition both make use of the same advanced (and proprietary) parser technology, and in this article I’m going to show you how to leverage the unique properties of the Editor to solve the previously stated problem elegantly (not as clumsy or random as a blaster. An elegant weapon, for a more civilized age???). First, the problem – In this case I’ve inherited a new database and want to begin exploring it. I begin by launching an Editor Worksheet and typing an initial query. Value add (and unique to Toad) is the ‘Hover Properties’ window with the yellow background shown here which gives me insight into schema, datatypes and comments on the table in question: And now, without leaving the editor, I can get an understanding of the columns and datatypes (and comments) on the OW_CUSTOMERS table, which means my flow is not slowed down by the need to leave the editor to understand the schema. Further, once I understand which columns (and their datatypes) are available to join, I can continue typing to find a suitable table to join on. For example, in this case OW_ORDERS has a column named CUST_ID as well. The value add is that Toad also that tells me that I can join OW_CUSTOMERS AND OW_ORDERS because in this case, the OW_ORDERS table is flagged as '(referenced)' as highlighted below, which lets me know I can join these two tables… To drive this point home, lets select from another table - OW_ORDERS and see the difference…in this case, you can see that I can join OW_ORDERS to both OW_CUSTOMERS AND OW_ORDER_LINES because of referential integrity…and because Toad calls it out clearly for me as shown below…pretty cool! And now, the cherry on top is that I can let Toad do a 'predictive join' for me, automatically offering to join OW_CUSTOMERS to OW_ORDERS via the shared CUST_ID field: PRO TIP: If I inherited a view or query, just mousing over the objects shows the ‘Hover Properties’ without me ever having to leave the editor!:
↧
Blog Post: Discover how the Toad Editor and Hover Properties can make writing queries even easier!
↧