Example: A 6   Usage of UDF RPAD
SELECT char(rpad( ABCDE ,12, *. ),20) FROM SYSIBM.SYSDUMMY1;
                                                   
1                    
                     
ABCDE*.*.*.*         
    1 record(s) selected.
                                                                          
SELECT char(rpad( ABCDE ,3, *. ),20) FROM SYSIBM.SYSDUMMY1;
                                                   
1                    
                     
ABC                  
    1 record(s) selected.
                                                                          
SELECT char(rpad( ABCDE ,20,  ) ||  X ,50) FROM SYSIBM.SYSDUMMY1;
                                                   
1                                                  
                                                   
ABCDE               X                              
1 record(s) selected.
UDF RPAD with the third parameter omitted is shown in Example A 7.
Example: A 7   RPAD Omitting the third parameter
CREATE FUNCTION RPAD (C1 VarChar(4000), N integer)
 RETURNS VARCHAR(4000)
 LANGUAGE SQL
 SPECIFIC RPADVarCharParm2
 DETERMINISTIC
 CONTAINS SQL
 NO EXTERNAL ACTION
 RETURN 
 RPAD(C1,N,   )
;
Running the RPAD function gives you the results shown in Example A 8.
Example: A 8   Results of RPAD omitting the third parameter
SELECT char(rpad( ABCDE ,15) ||  X ,50) FROM SYSIBM.SYSDUMMY1;
                                                   
340 
MySQL to DB2 UDB Conversion Guide






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