I've included my function below as it currently stands- although I suppose its part algorithm at this stage as im not sure how to implement the code correctly so it can be read within db2.
CREATE FUNCTION timeformat(time fmt varchar(20))
RETURNS varchar(20)
RETURN
year varchar(4)
month varchar(4)
day varchar(4)
year = substr(timefmt, 1,4)
month = substr(timefmt, 5,6)
day...
User Profile
Collapse
-
DB2 User Defined Function
Hi all,
I'm attempting to write a basic db2 function that converts the format of an inputted date of yyyymmddhhmm to dd/mm/yyyy. (DB2 8.1 on windows)
My approach was to strip the characters from the inputted date into individual variables then reconstruct them as a new variable into the format dd/mm/yyyy which will then be returned from the function.
Would this be the best approach to create this function? If...
No activity results to display
Show More
Leave a comment: