
Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Hi Serge
No, not porting from another product.
Just trying to implement the audit trail from hell. My
insert/update/delete triggers CALL a SP.
The insert/delete triggers are easy - they call a SP,
passing (TABLE, PK, OPERATION, USER)
However, the update trigger is more. It calls the SP with
TABLE, PK, OPERATION, USER, COLUMN, OLDVAL, NEWVAL)
where the COLUMN type and OLD/NEW values can be DATE,
CHAR/VARCHAR, or INTEGER.
I wanted to overload the SP by type, using wrapper SPs to
call the one that actually does the audit trail work. This
seemed better than clouding my triggers up w/ a bunch of
dummy SP params, or trying to CAST(), or using different SPs.
I'm also a Java developer, so overloading by type makes
sense to me.
I wound up CALLing different SPs from the update triggers
based on type.
Why is overloading by type in SP a big deal? DB2 is so
strongly typed I would think its easy.
thanks
aj
> AJ,
>
[quoted text clipped - 6 lines]
> Cheers
> Serge
Serge Rielau - 25 May 2006 16:34 GMT
> Hi Serge
>
[quoted text clipped - 23 lines]
> Why is overloading by type in SP a big deal? DB2 is so
> strongly typed I would think its easy.
Yes, it would be easy. But the customer base has shown little interest.
Few use function overloading. Need to follow the money....
But what you are looking for seems more to be implicit casting.
After allI take it your audit doesn't care what the source type was. You
log everything as varchar. So if DB2 would cast the integer to varchar
when passing the argument you'd be happy right?
Cheers
Serge
PS: that's the opposite of strong typing ;-)

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab