Archive for the ‘Oracle’ Category

call me hypocrite

Tuesday, August 11th, 2009

I feel guilty about saying I hate TOAD in the last post after spending the last 3 months with it open.
In fact, it’s the only application that’s open on every Virtual Window on my work machine.
I hate editing in TOAD. I like its autoformatting, love its schema browser and filtering on data grids, and love love love the fact you can read the script for tables, views, etc.

Vim’s too powerful to ignore.

In a perfect world I could run vim as my editor in TOAD; I haven’t figured out how to do that yet.

Compiling PL/SQL from VIM

Wednesday, May 20th, 2009

I don’t think I’ve extolled the virtues of vim, but it’s my favorite text editor by far. Whenever I’m in something that’s NOT vim, I can feel the pain.
What should take 3-4 keystrokes involves mousing and an excessive amount. Auto-indent, appropriate tab stops, shift widths, all that stuff is touch and go depending on the IDE and the time you want to take to configure it.
With vim, I sit in a .vimrc, set everything up the way I want it, and never deal with trivialities like that again.

Lately I’ve been stuck in PL/SQL-land – a chunk of new development in Oracle Time and Labor and some Pricing procedures I’ve been trying to optimize. I’ve been using TOAD, but I actually hate TOAD with most of my black little heart. Its Find functionality is spotty at best, and the amount of keystrokes/navigation is a pain in the butt even when you’re using hotkeys and bookmarks.
The newer version’s code folding is nice, but clutters the screen to a great extent.

The biggest pain, though, is just knowing it’s so damn inefficient when compared to a real text editor.
I’ve had 2-3 times in the last week where I realized a set of code should be sitting in an IF/ELSE construct. In vim it’s typing IF blah THEN, tapping j, then >>, then . for every line I need indented. Takes about 3 seconds tops. In TOAD I have to navigate, tab, then go to the beginning of the next line, hit tab, etc. ad nauseam.

So, naturally I want to use vim. I don’t want to be alt-tabbing and copy/pasting into TOAD to compile, however; I want to just compile in vim with :make.
Lo and behold:
The Answer To My Problem

This is awesome. I got it working today after an hour or so of fiddling with it. I would consider this my greatest accomplishment this week.
My boss would be enraged to hear it, I’m sure.
“You have deadlines!”

Yeah, I do.
And now that I’m vimming it up for PL/SQL, I’ll meet them easily.

The Perils of “Magic Numbers”

Tuesday, December 9th, 2008

Spent a portion of today at work debugging a connection between our custom render server, Oracle Applications, and Oracle Configurator.

Nothing too crazy; the new production roll-out isn’t capturing the links for images appropriately, and is displaying a completely gray page.

The good news: this didn’t take long to figure out in terms of “what’s happening” . . . the HTML file was rendering but no image was being inserted.

Browse to the appropriate workflow package, scan the “create_html” procedure and. . . .  voila!
The node name ‘DebugOutput’ was hard coded into the method, forcing every single future configuration product to use that field for any rendered URLs it might create. No documentation anywhere on this except in the code, and the name “DebugOutput” is just about as awful as it gets. I get the impression that the consultant who initially built this thing was building a prototype he expected to throw away. Either way, I go less than a month at a time wanting him drawn and quartered.

DEBUG OUTPUT? FOR SERIOUS?!?

I’m trying to decide how I feel about fixing it right now; obviously the extreme coupling this introduces is undesirable, but this is a workflow package directly responsible for generating HTML notifications about specific configurated products. I’m not sure what I gain by working out how to decouple the class appropriately. Ah well, I guess it’s a project for the ol’ whiteboard, with a fix coming in two parts:

  1. Change the current model to use “DebugOutput” – done because of due dates; since the name sucks as awesomely as it does, I’ll have to figure out a way to abstract it out of the working code
  2. Change the PL/SQL package to grab a “helper” value of some sort. Honestly, I’m probably better off just changing “DebugOutput” to “URLImageName” and being done with it. Of course, that forces me to look through old code where I wasn’t decoupled appropriately. . .

Ahh, development. The only thing that hurts more than learning is NOT learning.