Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
create function drdata.mmddyy(mydate decimal(6,0)) returns DATE language sql return CAST(left('20' || right(mydate,2) || '-' || right('0' || trim(mydate),6),2) || '-' || substr(right('0' || trim(mydate),6),3,2) as DATE); ;
SQL State: 22007
Vendor Code: -180
Message: [SQL0180] Syntax of date, time, or timestamp value not valid. Cause . . . . . : The string representation of a date, time, or timestamp value does not conform to the syntax for the specified or implied data type and format. SQL_RETURN.SQLF_OUTPUT is either the character string constant that is not valid or the column or host variable that contained the string. If the name is *N, then the value is an expression specified in the statement. If the string was found in a host variable, the host variable number is 1. Recovery . . . : Ensure that the date, time, or timestamp value conforms to the syntax for the data type it represents. Try the request again.