Writing code…

I am writing lots of code again. Building a package that imports different files into the database. I thought I should share a bit of my working experience with you. As you may (or may not) know, I am a big fan of Allround Automations PL/SQL Developer, so that’s my main tool for this job. Along with some of the plug-ins I built I think I have a nice toolbox on my hands.

  • CommentLine: One of the plug-ins I use most is my comment lines plug-in. Using a  key combination I can easily turn commenting on a group of lines on and off. Of course, you can use the built in functionality to comment out a block of source with the /* and */ comments, but first of all, I would have to select from the beginning of the first line to the end of the last line and it is harder to turn bits inside the comment on again.
  • Template: This plug-in can be used to make it easier to type lots of code. Just type a short template code, press a magic key combination (I use CTRL-J, like in the Delphi IDE) and have it expand to real code. For example I type pl, press CTRL-J and it will be expanded to DBMS_OUTPUT.PUT_LINE. That just 4 key-strokes instead of 20.
  • Column Edit: UltraEdit provides functionality to add/replace a column based value in the text file you are editing . For example, you want to prefix all the selected lines with a semicolon (,). When this should be done on 2 – 5 lines, you can easily do this line by line. However, when there’s more line involved, or the text is more than just the semicolon, it is easier to use the column editing possibilities. PL/SQL Developer does support selecting a piece of code column based, but then, all you can do is remove this block (or indent it a bit). The plug-in allows you to replace the selection, or add some text in front of or after the selection (on every line of course).
  • Selection Info: Retrieves some information about the current selection. For the moment it just returns the currently selected text and its length. This is especially useful when creating constants to hold for instance table names. Of course you can just declare the constant as a varchar2(30) but I like to make them as big as needed and no bigger than that ;-).  (Which gets me in trouble when the constant changes and gets bigger than before)
  • Reconnect: When creating new objects the IDE is not refreshed with regards to the code-insight part. The easiest way to do this is to reconnect to the same schema. To help me do this I have created the reconnect plug-in. It tries to reconnect to the same schema to which I am currently connected. This is just one click on a button in the toolbar, where I would otherwise need to go through the entire logon process :-).

Hopefully I will have some time again soon to write up some more interesting info. I am working on a way to test RuleGen rules using CodeGen and CodeTester but that’s in a very premature stadium and requires some more work. If only I could find the time to do this 😉 But it looks pretty promising at this moment.