Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

SHA256

SHA256

Calculates the SHA-256 digest of the input value. The function uses Secure Hash Algorithm 2 (SHA-2) and returns a 256 bit digest. SHA-256 is a one-way cryptographic hash function with a 256-bit hash value. You can conclude that input values are different when the SHA-256 digests of the input values are different. Use SHA256 to verify data integrity or to generate unique keys.
Note that the SHA-256 function returns different values when the PowerCenter Integration Service runs in ASCII and Unicode mode.
To use the
SHA256
function, set the environment variable
INFA_ENABLE_BINARY_FUNCTIONS
to True or Yes.

Syntax

SHA256(
value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
value
Required
String or binary datatype. The case-sensitive value for which you want to calculate digest.

Return Value

Unique 32-byte binary.
NULL if the input is a null value.

Example

You want to write changed data to a database. Use
SHA256
to generate hash digest values for rows of data you read from a source. When you run a session, compare the previously generated checksum values against the new checksum values. Then, write the rows with updated checksum values to the target. You can conclude that an updated checksum value indicates that the data has changed.
SHA256
can be used to generate primary keys in most cases.