Functional Equivalence Helpers

A list of helpers functions in JavaScript that procedures in SnowFlake can use, in order to better support several Teradata language features.

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Depending on what is in each Stored Procedure in Teradata, SnowConvert will create one or more of the following javascript functions inside them.

CompareDates

A function that compares dates handling nullity. In Javascript, it is needed to call .getTime() for date comparisons.

var CompareDates = function(value1, value2) {
	var value1Time = value1 && value1.getTime() || null;
	var value2Time = value2 && value2.getTime() || null;
	if (value1Time == null && value2Time == null) return null; /*in SQL null == null is equal to null as well as any other comparison */
	return value1Time > value2Time? 1 : value1Time<value2Time? -1 : 0;
}

BetweenFunc

A function to handle the BETWEEN statement in Teradata.

LikeFunction()

A function to handle the LIKE statement in Teradata.

ERROR_HANDLERS()

The main error-handling routine.

INSERT_TEMP

A function to create a temporary table using the argument query with the given parameters.

IS_NOT_FOUND()

A function that validates when a SELECT returns no values or a sentence affects zero rows. This is done in order to emulate the same behavior as Teradata, when there are exits or continue handlers for NOT FOUND EXCEPTIONS.

HANDLE_NOTFOUND()

This function uses the above IS_NOT_FOUND function to validate when an artificial error 'NOT FOUND' is being thrown.

PROCRESULTS()

A function that takes zero or multiple output parameters and binds them with the _OUTQUERIES in an array in order to be returned.

Known Issues

No issues were found.

No related EWIs.

Last updated