search cancel

TDM 4.10 Portal - HASHBYTES Function is not working as expected

book

Article ID: 237982

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

When trying to use the HASHBYTES function in SQL Server to generate a hash value in TDM Portal 4.10.0.58 seems to be generating invalid values and generating new value each time even though the input is fixed.
 
For example: Running the query SELECT HASHBYTES('SHA2_256', 'dslfdkjLK85kldhnv$n000#knf'); in SQL Server 2019 returns the output as 0x7B9ED39D4A842FCAA7AAA97D0C3B24FA373C1EA42E984795830E65DA210245B9 but when running the same query @execsql(R,SELECT HASHBYTES('SHA2_256', 'dslfdkjLK85kldhnv$n000#knf'))@  in TDM Portal returns the output as [[email protected]

Cause

Defect

Environment

Release : 4.10

Component : Web Portal - Generator

Resolution

The patch TDMWeb-4.10.5.0.zip address this issue and also recommended to use the new metafunction execsqlhex instead of execsql to get the output when call generates a byte array, which will be transformed into a hex string.

@execsql(R,SELECT HASHBYTES('SHA2_256', 'dslfdkjLK85kldhnv$n000#knf'))@ -->@execsqlhex(R,SELECT HASHBYTES('SHA2_256', 'dslfdkjLK85kldhnv$n000#knf'))@