Overriding default constructors

11 05 2010

When you create a custom data type in Oracle, it creates a default constructor for you. But you don’t have access to modify this constructor. This can be a problem if you need some error checking or business logic. The documentation only mentions that it is possible to override the default constructor. However, every time I tried to do it I would get an error message complaining that two functions signatures matched this call. And because it didn’t know which function to use, it wouldn’t let me use either.

After reading and rereading the documentation, googling, and asking questions on help forums, I finally discovered the solution by accident. What they don’t tell you is that in order to override the default constructor, you not only have to match the position and type of attributes but also their NAMES. Once I changed the names to match that of the actual attributes, it worked like a charm.





Flex Printing

7 12 2009

You’ve worked for months on your shiny new flex app. It has all the bells and whistles. Incredible data visualization that in just a few clicks delivers interactive graphs allowing the user to navigate to information they never thought possible. The customer is absolutely blown away. Then your phone rings a few days later. There is a problem, your flex app doesn’t print! “Print”, you say, “why on Earth would you want to do that?”

The customer now has a beautiful app that either prints out extremely pixelated and ugly or more often, not at all. And you are left scrambling trying to work around Flex’s Achilles heel, printing. Read the rest of this entry »





Scheduling with Date Mod Part 2

20 10 2009

So as the title suggests, this is the second part of a series on scheduling. In the first part we did some basic setup. Now we are ready to dig in. The goal here is to be able to model any recurring pattern no matter the cycle.

The linchpin in this solution is to define an anchor date and the cycle length for every schedule. Given those two pieces of information, we can calculate the day of cycle for any given date using date mod. So lets create a couple of tables.
Read the rest of this entry »





Scheduling with Date Mod Part 1

19 10 2009

One question that seems to come up a lot is how to model recurring schedules. That’s understandable, because schedules can get out of hand pretty quickly.

We need a template so that we can define a schedule and then some how project it out on a repeating basis. The single week schedules are pretty easy. We just record the day of week and for each schedule and day we look up that day of week to get the shift for that day.
Read the rest of this entry »








Follow

Get every new post delivered to your Inbox.