1
ABCDE X
1 record(s) selected.
SELECT char(rpad( ABCDE ,3) || X ,50) FROM SYSIBM.SYSDUMMY1;
1
ABCX
1 record(s) selected.
Function RPAD allows a set of different input arguments. Example A 9 shows two
more RPAD UDFs.
Example: A 9 RPAD with first parameter as integer, 2, and 3 parameters
CREATE FUNCTION RPAD (I1 Integer, N integer, C2 Varchar(4000))
RETURNS VARCHAR(4000)
LANGUAGE SQL
SPECIFIC RPADIntParm3
DETERMINISTIC
CONTAINS SQL
NO EXTERNAL ACTION
RETURN
RPAD(rtrim(char(I1)),N,C2)
;
CREATE FUNCTION RPAD (I1 Integer, N integer)
RETURNS VARCHAR(4000)
LANGUAGE SQL
SPECIFIC RPADIntParm2
DETERMINISTIC
CONTAINS SQL
NO EXTERNAL ACTION
RETURN
RPAD(rtrim(char(I1)),N, )
;
And Example A 10 shows the results of the previous UDFs.
Appendix A. Sample code for user defined functions
341
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