Example: A 19 User defined functions to map LEAST
DB2 UDB UDF(User Defined Function) Samples for Migration
2001/08/28, 08/29
Name of UDF: LEAST (P1 VarChar(254), P2 VarChar(254))
Used UDF: None
Description: Returns least value of list of data.
Author: TOKUNAGA, Takashi
CREATE FUNCTION LEAST (P1 VarChar(254), P2 VarChar(254))
RETURNS VarChar(254)
LANGUAGE SQL
SPECIFIC LEASTOracle2
DETERMINISTIC
CONTAINS SQL
NO EXTERNAL ACTION
RETURN
CASE
WHEN P1 <= P2 THEN P1
ELSE P2
END
;
LEAST function with three parameters
CREATE FUNCTION LEAST (P1 VarChar(254), P2 VarChar(254), P3 VarChar(254))
RETURNS VarChar(254)
LANGUAGE SQL
SPECIFIC LEASTOracle3
DETERMINISTIC
CONTAINS SQL
NO EXTERNAL ACTION
RETURN
CASE
WHEN P1 <= P2
THEN CASE
WHEN P1 <= P3 THEN P1
ELSE P3
END
ELSE CASE
354
MySQL to DB2 UDB Conversion Guide
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved