17 December 2011

Stupid Programming Tricks #9

Keeping it G-Rated

I have a focus problem – no, that’s not the part that is G-Rated.  My focus problem is that I jump around so many technologies I sometimes tie myself into knots trying to figure what should be, and maybe are, simple things.  No, that’s not bragging, more like an expression of frustration.  But it’s all fun, right?  Right?  My hat is off to those who find this stuff easy, ‘cause that for sure ain’t yr. obdnt. srvnt.

So with the warning to myself to keep both the whinging and the cursing to a minimum, let us proceed with an ODI Stupid Trick.

Going faster miles an hour    

Oh dear, that version is NSFW.  But you have to give the Pistols artistic license.  And it’s a fairly good comment on how much this issue frosted my cookies.

So I am working on my Essbase Special Project using ODI 11.1.1.5 and all is going swimmingly, sort of.  I’m even doing it all in the Cloud.  So what?

I had a Procedure that logs process status to a table (too many steps for emails).  I wanted one of the fields to be appname.dbname with those values passed by #VAR_AppName and #VAR_DbName.  I had these defined as Alphanumeric variables, No History, with a default value initially of ASOSamp and Sample; I subsequently set these to blank because I wanted to assign them via a Load Plan.  In any case, these were set to Declare Variables in my Package and off I went.

The problem
Except that some of the Procedures that used these variables didn't change their value.  Odd.  I deleted the variables from the Package and readded them and regenerated the Scenario(s).  Nope, still stuck, actually, no, only one of them.  Huh?

The Stupid ODI Trick, and yes, it was just luck that I found it
After a lot of experimentation which I believe included scratching my head and rubbing my belly while typing (that's hard to  do with one’s nose but I managed it), I was just about ready to delete the silly things (this would  NOT have been a trivial exercise as they are used through the Project) when I came across this (unanswered) post on OTN’s ODI forum by Steve Truesdale:
https://forums.oracle.com/forums/thread.jspa?messageID=9973095&#9973095
Which then led me to these two (instructive) links:
http://public.sttruesdale.fastmail.fm/ODI%20Variables%20-%20with%20History%20-%20Prompt%20at%20Runtime.png
http://public.sttruesdale.fastmail.fm/ODI%20Variables%20-%20No%20History.png

Simple, right?  :)  Just like everything else in ODI.
Nuke the entire site from orbit, it’s the only way to be sure
Channeling my inner Ripley, looking at the diagrams made me think -- I can't get that !@#$ing variable (whoops, so much for the G-rating) to change its value -- what if I changed its type from Alphanumeric to Numeric or Date or Text?  One of those ought to be an illegal type conversion and make the value GO AWAY. 

And so it was.

Sigh. 

At least the variables value now in the Load Plan, just the way they ought to.  That was NOT intuitive, but at least it worked.


No comments:

Post a Comment