If anyone's interested I've managed to fix this problem myself. The prototype in the objects.sql file for the StatPrint and StatCollect UDRs was incorrect.
Should have been :
"StatCollect (a_number,float,float) returns stat"
"StatPrint (a_number,stat) returns lvarchar"
Quote:
Originally posted by eamonnthedub
Any help on the problems below would be greatly appreciated :
Problem 1:
------------
When BladeSmith is used to create a UDT and I activate statistics functions, only StatCollect is installed. When I then try to add StatPrint seperately I get a message saying that a Routine with this signature exists.
I can get around this by adding StatPrint into the objects.sql directly for the moment but that's not ideal.
Is this a known bug with BladeSmith? BTW I'm running BladeSmith v4.00.TC3.
Problem 2:
------------
I've added StatPrint into objects.sql and written a C function to implement StatPrint for my specific UDT.
I've tried :
lvarchar StatPrint(void* dummy, lvarchar stat) -- as per example supplied
lvarchar StatPrint(UDT* dummy_udt, lvarchar stat) -- because this made more sense to me.
When I populate a table with some UDT values and run "update statistics high" this is successful i.e. picks up overloaded StatCollect
When I then try "dbschema -d my_db -hd udt_table" I get
"-937 - User Defined Routine error."
I'm 99.9% sure this error is not coming from my overloaded "StatPrint" function as this is the same error I was getting prior to writting the "StatPrint" function.
|