Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Calculating a Hash Value
Tue, Sep 29 2009 2:51 AMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Guys,

Is it possible to pass the equivalent of a dynamic array to an extension
function? I want to create a function that calculates a hash value based on
the array (of column values) passed to it. The function will be called by a
trigger whenever a record is created or updated and the resulting hash value
inserted into a column of the same table.

Best regards

Steve

Tue, Sep 29 2009 3:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve

Any reason why you can't just pass in all the columns? AFAIK there's no restriction on the number of columns you can pass in.

Roy Lambert [Team Elevate]
Tue, Sep 29 2009 8:44 AMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Roy,

Is there a way to do that generically? I want to use the function for a
hash value on records in a number of different tables.

Best regards

Steve

Roy Lambert wrote:
> Steve
>
> Any reason why you can't just pass in all the columns? AFAIK there's no restriction on the number of columns you can pass in.
>
> Roy Lambert [Team Elevate]
>
Tue, Sep 29 2009 9:46 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve

>Is there a way to do that generically? I want to use the function for a
>hash value on records in a number of different tables.

Not until Tim gets the array/row values thingy working. Until then how about passing in a single delimited parameter and splitting in the function eg

PROCESSFIELDS(field1+'¬'+field2+'¬'+CAST(field3 as varchar))

Roy Lambert [Team Elevate]
Tue, Sep 29 2009 4:19 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Is it possible to pass the equivalent of a dynamic array to an extension
function? I want to create a function that calculates a hash value based on
the array (of column values) passed to it. The function will be called by a
trigger whenever a record is created or updated and the resulting hash value
inserted into a column of the same table. >>

You won't be able to do so until we figure out a way to get a TParam to do
arrays.  In the meantime, Roy is correct, you simply need to pass the data
in as a VARCHAR that is delimited with a special character.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Sep 29 2009 5:33 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Thanks Tim Smile

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:EE3FCBF4-F931-4B2E-9856-BA4782218F66@news.elevatesoft.com...
> Steve,
>
> << Is it possible to pass the equivalent of a dynamic array to an
> extension function? I want to create a function that calculates a hash
> value based on the array (of column values) passed to it. The function
> will be called by a trigger whenever a record is created or updated and
> the resulting hash value inserted into a column of the same table. >>
>
> You won't be able to do so until we figure out a way to get a TParam to do
> arrays.  In the meantime, Roy is correct, you simply need to pass the data
> in as a VARCHAR that is delimited with a special character.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Tue, Sep 29 2009 5:34 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Roy,

Thanks mate Smile

Stevo

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:A3F59325-1C38-44B6-8B9A-02A0589C8126@news.elevatesoft.com...
> Steve
>
>>Is there a way to do that generically? I want to use the function for a
>>hash value on records in a number of different tables.
>
> Not until Tim gets the array/row values thingy working. Until then how
> about passing in a single delimited parameter and splitting in the
> function eg
>
> PROCESSFIELDS(field1+'¬'+field2+'¬'+CAST(field3 as varchar))
>
> Roy Lambert [Team Elevate]

Image