MSCEWI4029
Information for the column was not found. STRING used to match CAST operation
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
Medium
Description
This EWI is added in Table-Valued User Defined Functions where the return type of a column can not be determined during the conversion. STRING
is used as a default to match the CAST
operation in the SELECT
statement
Code Example
Input Code:
CREATE FUNCTION GetDepartmentInfo()
RETURNS TABLE
AS
RETURN
(
SELECT DepartmentID, Name, GroupName
FROM HumanResources.Department
);
Output Code:
CREATE OR REPLACE FUNCTION GetDepartmentInfo ()
RETURNS TABLE(
DepartmentID STRING /*** MSC-ERROR - MSCEWI4029 - INFORMATION FOR THE COLUMN DepartmentID WAS NOT FOUND. STRING DATATYPE USED TO MATCH CAST AS STRING OPERATION ***/,
Name STRING /*** MSC-ERROR - MSCEWI4029 - INFORMATION FOR THE COLUMN Name WAS NOT FOUND. STRING DATATYPE USED TO MATCH CAST AS STRING OPERATION ***/,
GroupName STRING /*** MSC-ERROR - MSCEWI4029 - INFORMATION FOR THE COLUMN GroupName WAS NOT FOUND. STRING DATATYPE USED TO MATCH CAST AS STRING OPERATION ***/
)
AS
$$
SELECT
CAST(DepartmentID AS STRING) /*** MSC-ERROR - MSCEWI4031 - INFORMATION FOR THIS EXPRESSION WAS NOT FOUND. CAST TO STRING USED TO MATCH THE DEFAULT STRING RETURN TYPE. ***/,
CAST(Name AS STRING) /*** MSC-ERROR - MSCEWI4031 - INFORMATION FOR THIS EXPRESSION WAS NOT FOUND. CAST TO STRING USED TO MATCH THE DEFAULT STRING RETURN TYPE. ***/,
CAST(GroupName AS STRING) /*** MSC-ERROR - MSCEWI4031 - INFORMATION FOR THIS EXPRESSION WAS NOT FOUND. CAST TO STRING USED TO MATCH THE DEFAULT STRING RETURN TYPE. ***/
FROM
HumanResources.Department
$$;
Recommendations
The user should check which is the correct data type that could not be found and change it in the
RETURNS TABLE
statement definition.If you need more support, you can email us at [email protected]
Last updated