Links

MSCEWI4029

Information for the column was not found. STRING used to match CAST operation

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-WARNING - MSCEWI4029 - INFORMATION FOR THE COLUMN DEPARTMENTID WAS NOT FOUND. STRING DATATYPE USED TO MATCH CAST AS STRING OPERATION ***/, NAME VARCHAR(50), GROUPNAME VARCHAR(50))
AS
$$
SELECT CAST(DEPARTMENTID AS STRING) /*** MSC-WARNING - MSCEWI4031 - INFORMATION FOR THIS EXPRESSION WAS NOT FOUND. CAST TO STRING USED TO MATCH THE DEFAULT STRING RETURN TYPE ***/, NAME, GROUPNAME
FROM HUMANRESOURCES.DEPARTMENT
$$;

Recommendations

  • The user should check which is the correct datatype that could not be found and change it in the RETURNS TABLE statement definition.
  • For more support, you can email us at [email protected] or post a message to our forums. If you have a contract for support with Mobilize.Net, reach out to your sales engineer and they can direct your support needs.