Oct
3
Written by:
Jeff Smith
10/3/2007

Every software product has a feature or widget that is extremely powerful, but finds a way to confuse more people than it enlightens. That is not to say that the feature is poorly designed or implemented, but who can really say they understand and use 100% of an item’s potential?
A few of my personal examples would be Office macros, regular expressions in vi, or collections in Oracle’s PL/SQL language. For Toad®, it seems that the one universal feature that eludes most users is the Team Coding feature. To be honest, it’s not that I am not smart enough to force my fingers to figure out how to use Regex in vi, it’s that I’m too lazy to take the time to figure it out. I can get away with not knowing that. However, if I DID understand it, how much more productive could I be? Let’s take a quick look at Team Coding together, and maybe I can convince you it’s worth a 2nd or 3rd look. John POcknell has already dedicated a blog to Team Coding, but I wanted to take a step back and look at it from a slightly different perspective.
Just What Exactly IS Team Coding?
Team Coding is a technology that was originally developed for SQL Navigator. It allows a developer to work on his or her stored procedure without worrying about a co-worker coming in and clobbering their work. This is such a common occurrence that the feature was frequently requested by our Nav friends when they started using Toad.
Most developers work in an environment where the programs they write are stored in a Source Control system. If a developer wants to work on program X, they login to the repository and ‘CHECK OUT’ program X. At this point, no one else can make changes to program X until the person who has it checked out is finished and checks it back in. This type of control is achieved by file locking.
The challenge for PL/SQL developers lies in the fact that the code for Oracle is evaluated at run-time and is stored in the database – not in a file. Team Coding was developed to achieve two things:
1. Allow Developers to control their PL/SQL objects in the database
2. Allow Developers to associate their controlled PL/SQL programs to their complimentary OS files in their Source Control system.
Controlling PL/SQL objects in the database
Team Coding can operate without a 3rd party Source Control system. In its simplest form, Team Coding consists of a series of database objects which tell Toad which PL/SQL programs are available. When a Toad user opens a Function into the Editor, Toad will tell them if it is controlled and if it is available. If the object is controlled by Team Coding, and if it is available, the user can then check it out. Once checked out, Toad will allow the user to compile their changes to the database. If the object is already checked out, Toad will tell you so and prevent you from making changes to the object.

Notice the compile button is disabled and the status of the object is listed below.
Team Coding is much easier to use if you have enabled the Toolbar. Right-Mouse-Click in the main toolbar/menu area of Toad and toggle it on. Once opened, you will be able to tell if your session is being affected by Team Coding.

The ‘checkmark’ button on the toolbar will show you the status for your session. You can see for my connection that Team Coding is available AND enabled. I also have the ability to create code control groups AND access the object control.
Team Coding requires a series of Server Side Objects in the database that you are connected to. These can be created using Toad’s Server Side Object Wizard, which is located on the Database > Administer menu flyout.
Once these items are created, you will see the ‘Team Coding Support Installed’ item marked with a green arrow on the Team Coding Status window.
Before we can start using Team Coding, we need to create something called a ‘Code Control Group’ or CCG. You can think of a CCG as a category or a logical grouping of database objects. Defining one allows the Toad user to create define multiple groups of objects in the database that can be controlled in different ways. This is extremely important if you are using a 3rd party file-based Source Control system. Having multiple CCGs allows you to assign multiple projects or workspaces (or different directories on your PC) that contain the files associated with your database objects.

Code Control Group (CCG) Diagram. Thanks for the awesome help topic Gretchen!
Creating a CCG is basically a 2-3 step process:
1. Create/Name the CCG
2. Define the mask properties
a. Object Type
b. Schema
c. Define an optional filter based on object name
3. If you are using a file-based system, you can now export the
objects in the CCG as files to the defined workspace.

You can see all of the objects being controlled by using the Team Coding Viewer.

Team Coding records the user who last touched the object and allows the developer to add comments that describe the changes made.
A Quick Example
I have a stored procedure compiled with errors in our development environment. My Development Manager has assigned me the work order specifying what needs to be done.
-
Step1: Make sure the object is available. I can see this with the Team Coding Viewer. If ‘Available’ I can check it out and proceed with fixing the errors.
-
Step2: Load the object into the Editor.
-
Step3: Check Out the Object.

When you load the object to the editor, if the object is under control and available, then the Team Coding toolbar will activate the Check Out button.
While performing the Check Out operation, Toad will prompt me for a comment. Try to use good comments as this will help you later when you try to track down why a change was implemented for a particular revision. It will also prevent ‘Why do you have XYZ checked out?” emails from your co-workers J
-
Step4: Fix the code.
-
Step5: Compile. This will overwrite the source of the object in the database.
-
Step6: Check In. Once you have made a change to the database source, the Check In button will activate. Again, you will be prompted for a comment.
I tried to describe this process in as few words as possible, but I’ve already exceed 1,000 words! The steps involved for setting up Team Coding to work with a 3rd party source control provider are a bit more involved. I’d like to propose the following: If you enjoyed this blog and are interested in implementing this in your environment with the file support enabled, then leave a comment on the blog. I’ll then follow-up this topic with a PTII that talks about the file support.
If you can’t wait that long, then I highly recommend reading the Help Topic. It’s quite substantial and it’s what I read when I have questions and don’t want to bother the poor developer.
8 comment(s) so far...
Re: Team Coding???
We used toad, pl/sql developer, sql developer and sqlplus. If team coding is implemented for toad, and a user check out a procedure. Will it be possible for other user to modify the procedure in another gui? like sqlplus?
By Steeveb on
10/4/2007
|
Re: Team Coding???
Team Coding is proprietary to Toad and SQLNav. It will aid those users only. Looks like it's time to standardize your users on Toad :)
It's a very nice feature to help your honest PL/SQL developers stay honest. If you wanted to get mean, you could write triggers to disallow access to your development schemas to the applications that you don't approve of...
By hillbillyToad on
10/5/2007
|
Re: Team Coding???
It's all Heterogeneous. Our user works on navision for our ERP system. Cognos for our BI solution. Salesforce for our CRM. And Oracle forms/reports for our custom software.
The same thing goes for our developer, we have 3 different development team, they all use different software. Different software for source control, for documentation and to work with the database.
I think it would of been a nice feature to call "team coding" package inside the database so it is possible to use that feature with other coding software as well.
By Steeveb on
10/5/2007
|
Re: Team Coding???
The information in terms of what objects are locked and by whom are stored in the TOAD.TC_% tables, so you could theoretically plug into that from your other applications...
I like your idea though. However, your other tools would have to be flexible enough to handle it.
By hillbillyToad on
10/5/2007
|
Re: Team Coding???
Hi Jeff.
I just started enabling team coding in toad 9.0.1.8. we want to use team coding with MS Visual safe 2005.
Team coding status shows 2 items are in red.
1. VCS Provider is not initialized.
2. VCS provided is not connected.
when open toad, i get the error
"22:38:48 Error: Error initializing Team Coding: Failed to initialize VCS provider: Class not registered"
I am not sure which class it refers to.
There is no LOV available in Toad options >> team coding >> source control Provider.
But, in team coding setting i have selected MS visual source safe, which is installed on a network derive, not in my pc, where i am running the toad.
Appreciate, how can i fix the class not registered error.
Ganesan
email: ganesan.srirangan2@alcoa.com
By Ganesan on
7/8/2008
|
Re: Team Coding???
Ganesan,
You need to make sure the VSS DLL is installed and registered for use on your machine. I'm not sure your network installation can work.
You may want to contact Quest Support if you get tripped up.
By hillbillyToad on
7/8/2008
|
Re: Team Coding???
By Dan Robinson on Wednesday, July 16, 2008 1:00 PM
Hi Jeff,
Trying to connect to a recently created production database through TOAD 9.0.1.8 and getting the error message: error initializing team coding: not logged on
I can can connect to different Oracle databses for other environments.
But, for some reason I keep getting this error.
Can connect to same database in TOAD 8.0.0.47
Can someone help, new to TOAD
dan.robinson@carefirst.com
By DROB on
7/16/2008
|
Re: Team Coding???
Dan,
That message indicates the 3rd party source control client isn't configured and Toad can't login for you. For example, you may have had Toad 8 setup to use VSS and you would have provided the same connection info for Toad 9. Now here's the weird part, if you upgraded Toad 8 to Toad 9, that should have carried over.
Did you do a side-by-side install of uninstall Toad 8 before installing Toad9?
Jeff
By hillbillyToad on
7/16/2008
|