RETURN 
 LPAD(rtrim(char(I1)),N,C2)
;
                                                                          
CREATE FUNCTION LPAD (I1 Integer, N integer)
 RETURNS VARCHAR(4000)
 LANGUAGE SQL
 SPECIFIC LPADIntParm2
 DETERMINISTIC
 CONTAINS SQL
 NO EXTERNAL ACTION
 RETURN 
 LPAD(rtrim(char(I1)),N,   )
;
And the results are shown in Example A 16.
Example: A 16   Results of LPAD: The first parameter is integer, 2, and 3 parameter
SELECT char(lpad(9021,15, *. ),50) FROM SYSIBM.SYSDUMMY1;
                                                   
1                                                  
                                                   
*.*.*.*.*.*9021                                    
    1 record(s) selected.
                                                                          
SELECT char(lpad(9021,15,  ),50) FROM SYSIBM.SYSDUMMY1;
                                                   
1                                                  
                                                   
           9021                                    
    1 record(s) selected.
                                                                          
SELECT char(lpad(9021,3),20) FROM SYSIBM.SYSDUMMY1;
                                                   
1                    
                     
 Appendix A. Sample code for user defined functions 
345






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

san diego web hosting

 

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