Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Troubles with LPAD

$
0
0
What am I missing here?? I want to pad with zeroes the week number column for the week numbers that are in the single digit e.g. "week number 01" instead of "week number 1" (DB2 v9 LUW).

db2 "SELECT WEEK_NUM, LPAD ( DIGITS(WEEK_NUM),2,'0' ) FROM MONTHDAY_DIM "

SQL0440N No authorized routine named "LPAD" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

db2 describe table monthday_dim

Column Type Type
name schema name Length Scale Nulls
------------------------------ --------- ------------------ -------- ----- ------
MONTHDAY_KEY SYSIBM TIMESTAMP 10 0 Yes
MONTHDAY_DATE SYSIBM TIMESTAMP 10 0 Yes
WEEK_END_DATE SYSIBM TIMESTAMP 10 0 Yes
YEAR_NUM SYSIBM INTEGER 4 0 Yes
MONTH_NUM SYSIBM INTEGER 4 0 Yes
MONTH_NAME SYSIBM VARCHAR 10 0 Yes
WEEK_NUM SYSIBM INTEGER 4 0 Yes
MONTH_OVERALL_NUM SYSIBM INTEGER 4 0 Yes
WEEKDAY_NUM SYSIBM INTEGER 4 0 Yes
WEEKDAY_NAME SYSIBM VARCHAR 9 0 Yes
WEEK_OVERALL_NUM SYSIBM INTEGER 4 0 Yes
……………..

Viewing all articles
Browse latest Browse all 13329

Trending Articles